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

Discussion in 'ASP .Net' started by Jlo, Mar 25, 2007.

  1. Jlo

    Jlo Guest

    Hi, set the customFormat to "dd/MM/yyyy"
    and format to custom


    "Eric Layman" <namyalcire[at no spam]gmail.com> wrote in message
    news:...
    > 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
     
    Jlo, Mar 25, 2007
    #1
    1. Advertising

  2. 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" %>
     
    Alexey Smirnov, Mar 25, 2007
    #2
    1. Advertising

  3. Jlo

    Eric Layman Guest

    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
     
    Eric Layman, Mar 25, 2007
    #3
  4. Jlo

    Eric Layman Guest

    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" <> wrote in message
    news:eFoT$...
    > Hi, set the customFormat to "dd/MM/yyyy"
    > and format to custom
    >
    >
    > "Eric Layman" <namyalcire[at no spam]gmail.com> wrote in message
    > news:...
    >> 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
     
    Eric Layman, Mar 25, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kenneth
    Replies:
    2
    Views:
    13,900
    Kenneth
    Jan 14, 2004
  2. David Lozzi

    Dates dates dates dates... SQL and ASP.NET

    David Lozzi, Sep 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    881
    Rob Schieber
    Sep 30, 2005
  3. Ashraf Ansari

    convert MM/dd/yyyy format into dd/MM/yyyy

    Ashraf Ansari, Aug 30, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    794
    Alexey Smirnov
    Aug 30, 2007
  4. Gilles Ganault

    Converting DD MM YYYY into YYYY-MM-DD?

    Gilles Ganault, Aug 17, 2009, in forum: Python
    Replies:
    18
    Views:
    1,382
    Mark Tolonen
    Aug 20, 2009
  5. J P Singh
    Replies:
    4
    Views:
    289
    J P Singh
    Feb 10, 2004
Loading...

Share This Page