473,883 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

date in format "dd/MM/yyyy" validation

Hi,

I program in asp.net. I have a date in TextBox in format "dd/MM/yyyy".
I would like to validate if the date is realy correct.

I used RegularExpressi onValidator with
ValidationExpre ssion="[0-3][0-9]/[0-1][0-9]/[1-2][0-9][0-9][0-9]", but user
can write date "31/02/2000" and validator says that it is correct (everybody
know that Febuary has 28 or 29 days).

I was thinking of using RangeValidator with Type="Date". But how to told
RangeValidator, that date is in format "dd/MM/yyyy" ?

Maybe it is easier solution ?
I would like to have total secure validation method in client site..

Thanks for help

Nov 11 '08
14 15344
"imbirek8" <im******@op.pl wrote in message
news:gf******** **@news.onet.pl ...
I user date in format "dd/MM/yyyy" not in format "MM/dd/yyyy". This
method doesn't work with this format.
Now that you're using a calendar control, and users cannot enter dates
manually, you no longer need to do any date format validation - that's the
whole point of using a date picker...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 11 '08 #11
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote:
>
Firstly, your date format is ambiguous. E.g. in that format, tomorrow's date
would appear as 12/11/2008. Some people will see that as 12 November but
others (e.g. our friends in US) will see it as 11 December 2008. You should
always display dates using a three-digit month.
Do you mean "three-character month"? That is, "12/Nov/2008"? I have
certainly never seen an interface that used a 3-digit month.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 13 '08 #12
"Tim Roberts" <ti**@probo.com wrote in message
news:mu******** *************** *********@4ax.c om...
>>Firstly, your date format is ambiguous. E.g. in that format, tomorrow's
date
would appear as 12/11/2008. Some people will see that as 12 November but
others (e.g. our friends in US) will see it as 11 December 2008. You
should
always display dates using a three-digit month.

Do you mean "three-character month"? That is, "12/Nov/2008"?
Yes. Apologies for usage of incorrect terminology.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 13 '08 #13
Tim Roberts wrote:
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote:
>Firstly, your date format is ambiguous. E.g. in that format, tomorrow's date
would appear as 12/11/2008. Some people will see that as 12 November but
others (e.g. our friends in US) will see it as 11 December 2008. You should
always display dates using a three-digit month.

Do you mean "three-character month"? That is, "12/Nov/2008"? I have
certainly never seen an interface that used a 3-digit month.
It is used. As 12-Nov-2008 not 12/Nov/2008 though.

In contexts where readers can be both American and European it
is a good way to ensure that everybody reads it as the same
date.

Arne
Nov 15 '08 #14
Arne Vajhøj <ar**@vajhoej.d kwrote:
>Tim Roberts wrote:
>"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote:
>>Firstly, your date format is ambiguous. E.g. in that format, tomorrow's date
would appear as 12/11/2008. Some people will see that as 12 November but
others (e.g. our friends in US) will see it as 11 December 2008. You should
always display dates using a three-digit month.

Do you mean "three-character month"? That is, "12/Nov/2008"? I have
certainly never seen an interface that used a 3-digit month.

It is used. As 12-Nov-2008 not 12/Nov/2008 though.
That's not a three-digit month. That's a three-character month, as I said.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 16 '08 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2504
by: Erik R.N. | last post by:
Hi I have a ACCESS2002 table with a date-field in format "dd-mm-yyyy" which I "export" to a txt-file ( ; and " " ) and upload the txt-file to a MYSQL-table where the datefield is a varchar-field. I want to sort on the MYSQL-date-field. How do I get a MYSQL-date-formated "yyyy-mm-dd" field which I can sort on ??
2
2192
by: Ian | last post by:
I would like to have some validation on a date field. The date format is dd/mm which is used for our financial year end. I suppose I need also consider leap years. Please can you shed some light on how I will be able to achieve this?
6
3435
by: Sabina | last post by:
Hello, How can I porting this code to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy') from VB to aspx? SelectCommand="SELECT * FROM tbl_Products WHERE tbl_Products.ProductStartDate <= to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy')"
1
1608
by: kaw480 | last post by:
I was wondering if there was a way to show when a page was updated, and have that date displayed on a page.
5
4224
mgpsivan
by: mgpsivan | last post by:
Hi, i have form in Asp.net(2003) in that i've to change the format of the date by the following statement Format(Date.Today, "dd/mm/yyyy") but when i give this code the month part displays as 00 i.e i get the output as the folowing for eg: "18/00/2007" can any one help me in changing the format... Thanks in Advance..... Sivan.G.....
1
2806
by: nudrat | last post by:
I have a form in ASP, where Date has to display in "dd/mm/yyyy" format. when I am saving that format into database its giving either error message or saving incorrect date. because sql used to insert dates in "dd/mm/yyyy" format. say if date is 24 sep 2007, in sql it will not save as "24/09/2007", it will be out of script range error and if date is 3 sep 2007 , then sql will treat as 9 March 2007. please find a solution for that. Thanks &...
2
4736
by: stainless | last post by:
I know this is probably simple but I cannot find a method of converting a date string into a format that matches the DatePicker format in C# eg string "20080131" converted to "31 January 2008" I tried datetime.parseexact but could not find the definition for the appropriate format string. This would be a very useful tool fo me. Any ideas,please?
3
31507
by: maminx | last post by:
Hello all, asking again i want to convert format date from "YYYY-mm-dd" to "dd-mm-YYYY" example from "2008-08-16" become format date like this one "16-08-2008" is it anyone who has this library??thanks
1
9786
by: JFKJr | last post by:
Hello everyone, this one might be simple but driving me crazy! Your help will be greatly appreciated. Basically, I created a textbox bound to "Date" field in an Access VBA form. But when the field has date in "mm/dd/yyyy" format (for ex: 09/03/2008), the textbox displays it as 9/3/2008. Can anyone suggest how to display date in "mm/dd/yyyy" format in a bounded textbox. Thanks!
0
9944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7977
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7136
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3241
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.