.NETGURU
Date Input on a Web Page in US & UK Format
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngreg' list.


Richard.Baker
I am attempting to design a web page which will be used in the US and UK and
will require date input. Ideally I want to force the user to input the date
in the either the 01-JAN-2002 or 2002-JAN-01 format so there will not be
confusion between the UK(d/m/y) and US(m/d/y) date formats, but I cannot see
how to validate text box input to these formats.

Has anyone done anything similar?

Many thanks
Richard.

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
*************************************************************************
Reply to this message...
 
    
Daniel Naumann
Date Input on a Web Page in US & UK FormatHi Richard,

This probably isn't much help, but the regular expression validation control is pretty good at that
kind of thing. I haven't used it myself, but I've seen it used to do that type of thing.

Daniel.
-----Original Message-----
From: Richard.Baker [mailto:Click here to reveal e-mail address]
Sent: 21-Dec-2001 04:05
To: aspngreg
Subject: [aspngreg] Date Input on a Web Page in US & UK Format

I am attempting to design a web page which will be used in the US and UK and will require date
input. Ideally I want to force the user to input the date in the either the 01-JAN-2002 or
2002-JAN-01 format so there will not be confusion between the UK(d/m/y) and US(m/d/y) date formats,
but I cannot see how to validate text box input to these formats.

Has anyone done anything similar?

Many thanks

Richard.

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
*************************************************************************
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
    
Trevor
ASP.NET culture settings will force someone with CurrentUICulture of US to
enter date in MM/DD/YYYY format.

If you want the user to enter the date in

01-MMM-YYYY format... I *think* you'll need to use a regular expression.

Why are you forcing the user to type in FEB or MAR anyways??? that doesn't
seem like FAST data entry if multiple people are using the system having to
enter dates. You should make them enter dates in 01/01/2001 type
format. This way you can take advantage of built in Leap Year detection
etc. etc.

-Trevor

At 06:05 PM 12/20/2001 +0000, you wrote:

[Original message clipped]

Reply to this message...
 
    
=?iso-8859-1?Q?Patrice_Calv=E9?=
Hi,

May I suggest using a yyyy/mm/dd format... This has the advantage that
when sorted by a "textual representation", the records are then
displayed by year, then month and then day... (was usefull in those
"old" consoles...). Even more picky... make sure that mm and dd are in
00 format (like 01/01 so that you don't end up with a 11 before a 2)

Another advantage of using the year at the left is that there's no way
to confuse the syntaxe, it's always y/m/d. But using the year on the
right, there could be two representations: m/d/y and d/m/y. Back to
that damn y2k thingy...

01/02/03 = ???
2001/01/02 is usually always correct.

Just a thought (and a habbit)

Pat

-----Original Message-----
From: Trevor [mailto:Click here to reveal e-mail address]
Sent: Thursday, December 20, 2001 19:39
To: aspngreg
Subject: [aspngreg] Re: Date Input on a Web Page in US & UK Format

ASP.NET culture settings will force someone with CurrentUICulture of US
to enter date in MM/DD/YYYY format.

If you want the user to enter the date in

01-MMM-YYYY format... I *think* you'll need to use a regular expression.

Why are you forcing the user to type in FEB or MAR anyways??? that
doesn't seem like FAST data entry if multiple people are using the
system having to enter dates. You should make them enter dates in
01/01/2001 type format. This way you can take advantage of built in
Leap Year detection etc. etc.

-Trevor

At 06:05 PM 12/20/2001 +0000, you wrote:

I am attempting to design a web page which will be used in the US and UK
and will require date input. Ideally I want to force the user to input
the date in the either the 01-JAN-2002 or 2002-JAN-01 format so there
will not be confusion between the UK(d/m/y) and US(m/d/y) date formats,
but I cannot see how to validate text box input to these formats.

Has anyone done anything similar?

Many thanks

Richard.

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
************************************************************************
*
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
    
Richard.Baker
I am slightly confused by what you are saying; the ASP.NET code is all
running on the server how does it know the user is in the US or UK? Also we
have users that travel between the US and UK regularly and do not use their
own PCs so I need a format that will not cause confusion.

-----Original Message-----
From: Trevor [mailto:Click here to reveal e-mail address]
Sent: 21 December 2001 00:39
To: aspngreg
Subject: [aspngreg] Re: Date Input on a Web Page in US & UK Format

ASP.NET culture settings will force someone with CurrentUICulture of US to
enter date in MM/DD/YYYY format.

If you want the user to enter the date in

01-MMM-YYYY format... I *think* you'll need to use a regular expression.

Why are you forcing the user to type in FEB or MAR anyways??? that doesn't
seem like FAST data entry if multiple people are using the system having to
enter dates. You should make them enter dates in 01/01/2001 type format.
This way you can take advantage of built in Leap Year detection etc. etc.

-Trevor

At 06:05 PM 12/20/2001 +0000, you wrote:

I am attempting to design a web page which will be used in the US and UK and
will require date input. Ideally I want to force the user to input the date
in the either the 01-JAN-2002 or 2002-JAN-01 format so there will not be
confusion between the UK(d/m/y) and US(m/d/y) date formats, but I cannot see
how to validate text box input to these formats.

Has anyone done anything similar?

Many thanks

Richard.

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
*************************************************************************
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp
<http://www.asplists.com/asplists/aspngreg.asp> = JOIN/QUIT
| http://www.asplists.com/search <http://www.asplists.com/search> = SEARCH
Archives
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
*************************************************************************
Reply to this message...
 
    
Richard.Baker
I might be able to convince my users to this format. If you are using this
format how are you validating the input, by using a regular expression in
the RegularExpressionValidator?

Richard.

-----Original Message-----
From: Patrice Calvé [mailto:Click here to reveal e-mail address]
Sent: 21 December 2001 02:31
To: aspngreg
Subject: [aspngreg] Re: Date Input on a Web Page in US & UK Format

Hi,

May I suggest using a yyyy/mm/dd format... This has the advantage that when
sorted by a "textual representation", the records are then displayed by
year, then month and then day... (was usefull in those "old" consoles...).
Even more picky... make sure that mm and dd are in 00 format (like 01/01 so
that you don't end up with a 11 before a 2)

Another advantage of using the year at the left is that there's no way to
confuse the syntaxe, it's always y/m/d. But using the year on the right,
there could be two representations: m/d/y and d/m/y. Back to that damn y2k
thingy...

01/02/03 = ???
2001/01/02 is usually always correct.

Just a thought (and a habbit)

Pat

-----Original Message-----
From: Trevor [mailto:Click here to reveal e-mail address]
Sent: Thursday, December 20, 2001 19:39
To: aspngreg
Subject: [aspngreg] Re: Date Input on a Web Page in US & UK Format
ASP.NET culture settings will force someone with CurrentUICulture of US to
enter date in MM/DD/YYYY format.

If you want the user to enter the date in

01-MMM-YYYY format... I *think* you'll need to use a regular expression.
W
hy are you forcing the user to type in FEB or MAR anyways??? that doesn't
seem like FAST data entry if multiple people are using the system having to
enter dates. You should make them enter dates in 01/01/2001 type format.
This way you can take advantage of built in Leap Year detection etc. etc.

-Trevor

At 06:05 PM 12/20/2001 +0000, you wrote:

I am attempting to design a web page which will be used in the US and UK and
will require date input. Ideally I want to force the user to input the date
in the either the 01-JAN-2002 or 2002-JAN-01 format so there will not be
confusion between the UK(d/m/y) and US(m/d/y) date formats, but I cannot see
how to validate text box input to these formats.

Has anyone done anything similar?

Many thanks

Richard.

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
*************************************************************************
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp
<http://www.asplists.com/asplists/aspngreg.asp> = JOIN/QUIT
| http://www.asplists.com/search <http://www.asplists.com/search> = SEARCH
Archives
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
*************************************************************************
Reply to this message...
 
    
=?iso-8859-1?Q?Patrice_Calv=E9?=
Validation.. mmm. Depending on the format and how critical the
exactitude of the date inputed was we either splitted the date in 3
input boxes (year, month, day). At that point, it's fairly easy and
safe to work with.

If using a standard Input Box... it's coding as usual (nothing fancy...)

Pat

Patrice Calvé
Développeur Sénior - Senior Software Developer
Cactus Communications Internet
376 boul. St. Joseph
Hull, QC
J8Y3Y7
* Phone: 819.778.0313 * Fax: 819.420.0121
* E-mail:Click here to reveal e-mail address * Web:www.cactus.ca
"Make it idiot proof and someone will make a better idiot"
-----Original Message-----
From: Richard.Baker [mailto:Click here to reveal e-mail address]
Sent: Friday, December 21, 2001 03:55
To: aspngreg
Subject: [aspngreg] Re: Date Input on a Web Page in US & UK Format

I might be able to convince my users to this format. If you are using
this format how are you validating the input, by using a regular
expression in the RegularExpressionValidator?

Richard.

-----Original Message-----
From: Patrice Calvé [mailto:Click here to reveal e-mail address]
Sent: 21 December 2001 02:31
To: aspngreg
Subject: [aspngreg] Re: Date Input on a Web Page in US & UK Format

Hi,

May I suggest using a yyyy/mm/dd format... This has the advantage that
when sorted by a "textual representation", the records are then
displayed by year, then month and then day... (was usefull in those
"old" consoles...). Even more picky... make sure that mm and dd are in
00 format (like 01/01 so that you don't end up with a 11 before a 2)

Another advantage of using the year at the left is that there's no way
to confuse the syntaxe, it's always y/m/d. But using the year on the
right, there could be two representations: m/d/y and d/m/y. Back to
that damn y2k thingy...

01/02/03 = ???
2001/01/02 is usually always correct.

Just a thought (and a habbit)

Pat

-----Original Message-----
From: Trevor [mailto:Click here to reveal e-mail address]
Sent: Thursday, December 20, 2001 19:39
To: aspngreg
Subject: [aspngreg] Re: Date Input on a Web Page in US & UK Format
ASP.NET culture settings will force someone with CurrentUICulture of US
to enter date in MM/DD/YYYY format.

If you want the user to enter the date in

01-MMM-YYYY format... I *think* you'll need to use a regular expression.

Why are you forcing the user to type in FEB or MAR anyways??? that
doesn't seem like FAST data entry if multiple people are using the
system having to enter dates. You should make them enter dates in
01/01/2001 type format. This way you can take advantage of built in
Leap Year detection etc. etc.

-Trevor

At 06:05 PM 12/20/2001 +0000, you wrote:

I am attempting to design a web page which will be used in the US and UK
and will require date input. Ideally I want to force the user to input
the date in the either the 01-JAN-2002 or 2002-JAN-01 format so there
will not be confusion between the UK(d/m/y) and US(m/d/y) date formats,
but I cannot see how to validate text box input to these formats.

Has anyone done anything similar?

Many thanks

Richard.

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
************************************************************************
*
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

***********************************************************************
* The information in this message is confidential, unless
* otherwise stated. It is intended solely for the addressee
* Access to this message by anyone else is unauthorised.
* If you are not the intended recipient, any disclosure,
* copying, distribution or any action taken or omitted to be
* taken in reliance on it is prohibited and may be unlawful.
* We will not be liable for any error in transmission. Whilst
* any attachments to this message may have been checked
* for viruses, you should rely on your own virus checker and
* procedures, and we therefore exclude all liability arising out
* of any viruses that might exist in any attachment. If you
* contact us by email, we will store your name and address
* to facilitate communications. We do not accept legal
* responsibility for the contents of this message. Any
* statements contained herein that do not relate to the official
* business of VISTA are neither given nor endorsed by VISTA
* and are those of the individual and not of VISTA.
************************************************************************
*
| [aspngreg] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngreg.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
 
System.Web.UI.MobileControls.RegularExpressionValidator
System.Web.UI.WebControls.RegularExpressionValidator




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification