473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to have dates in dd/mm/yyyy format?

Hi,

In general, how do u configure/script to allow .net to accept date in
dd/mm/yyyy format?

By default, my sys only allows mm/dd/yyyy format.

Eg:

Take alook at

<asp:RangeValidator ID="RangeValidator1"

ControlToValidate="dob"

MinimumValue="01/01/1901"

MaximumValue="31/12/2001"

Type="Date"

EnableClientScript="true"

Text="The date must be between 01/01/1901 and 31/12/2001."

runat="server" />

Even if I key in 31/12/2001, i would hit an exception error. This happens
because 31/12/2001 is regarded as mm/dd/yyyy !

But I want my format to be in dd/mm/yyyy.

Users have to key in dd/mm/yyyy format.
Can someone give some pointers? Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 25 '07 #1
3 2872
Jlo
Hi, set the customFormat to "dd/MM/yyyy"
and format to custom
"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11*************@sp6iad.superfeed.net...
Hi,

In general, how do u configure/script to allow .net to accept date in
dd/mm/yyyy format?

By default, my sys only allows mm/dd/yyyy format.

Eg:

Take alook at

<asp:RangeValidator ID="RangeValidator1"

ControlToValidate="dob"

MinimumValue="01/01/1901"

MaximumValue="31/12/2001"

Type="Date"

EnableClientScript="true"

Text="The date must be between 01/01/1901 and 31/12/2001."

runat="server" />

Even if I key in 31/12/2001, i would hit an exception error. This happens
because 31/12/2001 is regarded as mm/dd/yyyy !

But I want my format to be in dd/mm/yyyy.

Users have to key in dd/mm/yyyy format.
Can someone give some pointers? Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Mar 25 '07 #2
Thanks Jlo,

But there's no customformat attribute in the rangevalidator

Im on .net 1.1

Is this a better option or shall i use web.config and modify the culture
settings?

"Jlo" <lo*******@gmail.comwrote in message
news:eF**************@TK2MSFTNGP04.phx.gbl...
Hi, set the customFormat to "dd/MM/yyyy"
and format to custom
"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11*************@sp6iad.superfeed.net...
>Hi,

In general, how do u configure/script to allow .net to accept date in
dd/mm/yyyy format?

By default, my sys only allows mm/dd/yyyy format.

Eg:

Take alook at

<asp:RangeValidator ID="RangeValidator1"

ControlToValidate="dob"

MinimumValue="01/01/1901"

MaximumValue="31/12/2001"

Type="Date"

EnableClientScript="true"

Text="The date must be between 01/01/1901 and 31/12/2001."

runat="server" />

Even if I key in 31/12/2001, i would hit an exception error. This happens
because 31/12/2001 is regarded as mm/dd/yyyy !

But I want my format to be in dd/mm/yyyy.

Users have to key in dd/mm/yyyy format.
Can someone give some pointers? Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com




Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 25 '07 #3
On Mar 25, 11:37 pm, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
Thanks Jlo,

But there's no customformat attribute in the rangevalidator

Im on .net 1.1

Is this a better option or shall i use web.config and modify the culture
settings?
If you do not set a proper culture for the application, you should use
a culture-neutral format, such as YYYY/MM/DD, for the MaximumValue and
MinimumValue properties. Otherwise, the date may not be interpreted
correctly. In other case, change a culture, either in web.config, or
on the page, e.g. <%@ Page Language="C#" Culture="en-GB" %>

Mar 25 '07 #4

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

Similar topics

8
by: Riley | last post by:
The date fields being saved by a VB program were being saved as #2003-11-22#. For reasons unknown to me these dates began to be saved as "11/22/2003" All of these dates were made dates with the...
1
by: GMG | last post by:
By providing a DTD in an XML document which is bound to HTML controls, Internet Explorer will automatically format the display of the date fields. For example 2004-08-03T00:00:00 will be displayed...
13
by: Deano | last post by:
Hi, I generate a report using two dates (From and To). I notice if I enter 01/10/2003 that it is interpreted by Access as 10/01/2003 i.e 10th January rather than 1st October as I intended. ...
9
by: deko | last post by:
What is it with these dates? What are they so much trouble? All I want to do is subtract an hour, but not if that makes dtmTest less than dtmClt. Dim dtmStart As Date Dim dtmEnd As Date Dim...
2
by: xenophon | last post by:
I am trying to format datetime output with an HTTP Module. Right now dates are displaying in US format like "MM/DD/YYYY 12:00:00". I want to change the output to "MM/DD/YYYY" if US or "DD.MM.YYYY"...
5
by: Tom | last post by:
It appears that you can't compare two dates in DotNet. You must use ToString and compare the strings. Is that the only reliable way? Try this: Dim dteOne As Date =...
2
by: Yog | last post by:
Is there a best way to handle various formats of dates for SQL server?. The data comes in various input files with different date formats. The ParseExact function looks like an "evil" and it...
2
by: Twanne | last post by:
How do you compare dates that are in dd/mm/yyyy format?? Al my dates are stored like this but access keeps checking them by mm/dd/yyy format. When access can't convert my dd/mm/yyyy format, it uses...
1
by: magicscreen | last post by:
I am trying to create a CSV export file that has a date field. If you look at the table in Access the date looks like mm/dd/yyyy. I want to run the export wizard to create a spec so I can use it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.