How do I display dates in a format consistent with the user's computer?

Discussion in 'HTML' started by ted, Dec 10, 2004.

  1. ted

    ted Guest

    I see many sites that display a date in the format of 02/03/04. Which number
    is the year, month and day? Who knows.

    Is there a way for me to query the OS's date format and display a date
    consistent with that format?

    Thanks
    ted, Dec 10, 2004
    #1
    1. Advertising

  2. ted

    Richard Guest

    ted wrote:

    > I see many sites that display a date in the format of 02/03/04. Which
    > number is the year, month and day? Who knows.


    > Is there a way for me to query the OS's date format and display a date
    > consistent with that format?


    > Thanks


    Display them all and let them figure it out.
    Richard, Dec 10, 2004
    #2
    1. Advertising

  3. ted

    Mark Parnell Guest

    Previously in alt.html, ted <> said:

    > Is there a way for me to query the OS's date format and display a date
    > consistent with that format?


    Yeah sure, check my OS settings. Why not change a few while you're
    there?

    IOW, no. It would be a massive security risk.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Dec 10, 2004
    #3
  4. ted

    Karl Core Guest

    "ted" <> wrote in message
    news:kl7ud.45$Mp4.22@lakeread07...
    >I see many sites that display a date in the format of 02/03/04. Which
    >number is the year, month and day? Who knows.
    >
    > Is there a way for me to query the OS's date format and display a date
    > consistent with that format?
    >


    You think the visitor doesn't know what day it is, and/ or cannot get that
    from their own computer?
    Are they coming to your site to find out what day it is, or are they coming
    for a different reason?

    --
    -Karl Core
    Please Support "Project Boneyard":
    http://www.insurgence.net/info.aspx?action=band&item=boneyard
    Karl Core, Dec 10, 2004
    #4
  5. ted

    Greg Schmidt Guest

    On Thu, 9 Dec 2004 21:06:16 -0500, Karl Core wrote:

    > "ted" <> wrote in message
    > news:kl7ud.45$Mp4.22@lakeread07...
    >>I see many sites that display a date in the format of 02/03/04. Which
    >>number is the year, month and day? Who knows.


    Well, I know that your example should be March 4, 2002, but many (who
    have never had to write a routine to sort date strings) would disagree.

    >> Is there a way for me to query the OS's date format and display a date
    >> consistent with that format?

    >
    > You think the visitor doesn't know what day it is, and/ or cannot get that
    > from their own computer?
    > Are they coming to your site to find out what day it is, or are they coming
    > for a different reason?


    What about a travel site, where they are asking you to confirm your
    itinerary? A bank confirming the date of a future bill payment? A
    history site listing famous battles, a sports team's schedule, the date
    on an archived press release. Many examples where the date shown is not
    today's date.

    I personally would prefer to see the date given as Dec 10, 2004 (or, if
    space is really that critical, Dec10/04 fits into the same 8 chars as
    the OP's example).

    --
    Greg Schmidt
    Trawna Publications http://www.trawna.com/
    Greg Schmidt, Dec 10, 2004
    #5
  6. ted wrote:

    > I see many sites that display a date in the format of 02/03/04. Which
    > number is the year, month and day? Who knows.


    2nd February 2004 leaves no room for misunderstanding (unless the user
    doesn't read that language - in which case why are they reading the
    document anyway? :)

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Dec 10, 2004
    #6
  7. ted

    Neal Guest

    On Thu, 9 Dec 2004 20:55:12 -0500, ted <>
    wrote:

    > I see many sites that display a date in the format of 02/03/04. Which
    > number
    > is the year, month and day? Who knows.
    >
    > Is there a way for me to query the OS's date format and display a date
    > consistent with that format?


    Never heard of a workable method. Best practice - state month explicitly,
    state year in full form. Use your correct local format.

    04 March 2002
    March 4, 2002
    etc.
    Neal, Dec 10, 2004
    #7
  8. ted

    BJ in Texas Guest

    ted wrote:
    || I see many sites that display a date in the format of
    || 02/03/04. Which number is the year, month and day? Who knows.
    ||
    || Is there a way for me to query the OS's date format and
    || display a date consistent with that format?
    ||
    || Thanks

    Try 02 Mar 04 or 03 Feb 04, most can figure that out and it only
    takes one more space.

    BJ
    BJ in Texas, Dec 10, 2004
    #8
  9. ted

    steven Guest

    "BJ in Texas" <> wrote in message
    news:nRiud.42475$...
    > ted wrote:
    > || I see many sites that display a date in the format of
    > || 02/03/04. Which number is the year, month and day? Who knows.
    > ||
    > || Is there a way for me to query the OS's date format and
    > || display a date consistent with that format?
    > ||
    > || Thanks
    >
    > Try 02 Mar 04 or 03 Feb 04, most can figure that out and it only
    > takes one more space.
    >
    > BJ
    >


    ISO8601: 2004-03-02

    http://www.cl.cam.ac.uk/~mgk25/iso-time.html
    http://www.saqqara.demon.co.uk/datefmt.htm
    http://www.hermetic.ch/cal_stud/formats.htm
    steven, Dec 10, 2004
    #9
  10. ted

    steven Guest

    "Greg Schmidt" <> wrote in message
    news:...
    > On Thu, 9 Dec 2004 21:06:16 -0500, Karl Core wrote:
    >
    > > "ted" <> wrote in message
    > > news:kl7ud.45$Mp4.22@lakeread07...
    > >>I see many sites that display a date in the format of 02/03/04. Which
    > >>number is the year, month and day? Who knows.

    >
    > Well, I know that your example should be March 4, 2002, but many (who
    > have never had to write a routine to sort date strings) would disagree.
    >


    You do? I think it could be any one of
    March 4, 2002
    March 2, 2004
    February 3, 2004.

    > >> Is there a way for me to query the OS's date format and display a date
    > >> consistent with that format?

    > >
    > > You think the visitor doesn't know what day it is, and/ or cannot get

    that
    > > from their own computer?
    > > Are they coming to your site to find out what day it is, or are they

    coming
    > > for a different reason?

    >
    > What about a travel site, where they are asking you to confirm your
    > itinerary? A bank confirming the date of a future bill payment? A
    > history site listing famous battles, a sports team's schedule, the date
    > on an archived press release. Many examples where the date shown is not
    > today's date.
    >
    > I personally would prefer to see the date given as Dec 10, 2004 (or, if
    > space is really that critical, Dec10/04 fits into the same 8 chars as
    > the OP's example).
    >


    How about ISO8601: 2004-03-02

    http://www.cl.cam.ac.uk/~mgk25/iso-time.html
    http://www.saqqara.demon.co.uk/datefmt.htm
    http://www.hermetic.ch/cal_stud/formats.htm
    steven, Dec 10, 2004
    #10
  11. ted

    steven Guest

    "Neal" <> wrote in message
    news:eek:...
    > On Thu, 9 Dec 2004 20:55:12 -0500, ted <>
    > wrote:
    >
    > > I see many sites that display a date in the format of 02/03/04. Which
    > > number
    > > is the year, month and day? Who knows.
    > >
    > > Is there a way for me to query the OS's date format and display a date
    > > consistent with that format?

    >
    > Never heard of a workable method.


    Like ISO8601, you mean?

    > Best practice - state month explicitly,
    > state year in full form. Use your correct local format.
    >
    > 04 March 2002
    > March 4, 2002
    > etc


    Nah. You don't want to do that.
    steven, Dec 10, 2004
    #11
  12. ted

    Neal Guest

    steven:
    > Neal:
    >> Never heard of a workable method.

    >
    > Like ISO8601, you mean?


    Outside of technical uses, it's not particularly useful to the average
    Joe. Average Joe has not read ISO 8601, and he wants a more human-readable
    format than that. Also, there is no guarantee that 2004-12-10 cannot be
    mistaken for October 12, 2004 by individuals unaware of the ISO standard.

    Essentially, unless you and your reader both know a standard, the standard
    is not worth using, especially if there's an even better way.

    >> Best practice - state month explicitly,
    >> state year in full form. Use your correct local format.
    >>
    >> 04 March 2002
    >> March 4, 2002
    >> etc

    >
    > Nah. You don't want to do that.


    Why? Is it ambiguous in the least? This method has the least chance of
    being misinterpreted, slightly less even than the ISO standard.
    Neal, Dec 10, 2004
    #12
  13. ted

    rf Guest

    steven wrote
    > > >>I see many sites that display a date in the format of 02/03/04. Which
    > > >>number is the year, month and day? Who knows.


    > You do? I think it could be any one of

    ....
    > February 3, 2004.

    Only 4% of the worlds population would have thought this :)

    --
    Cheers
    Richard.
    rf, Dec 10, 2004
    #13
  14. ted

    Duende Guest

    While sitting in a puddle rf scribbled in the mud:

    > steven wrote
    >> > >>I see many sites that display a date in the format of 02/03/04. Which
    >> > >>number is the year, month and day? Who knows.

    >
    >> You do? I think it could be any one of

    > ...
    >> February 3, 2004.

    > Only 4% of the worlds population would have thought this :)
    >


    Do you have documentation to backup that number?

    --
    Mr. D?
    Never trust a cat to do a dog's job.
    Duende, Dec 10, 2004
    #14
  15. ted

    rf Guest

    Duende wrote:
    > While sitting in a puddle rf scribbled in the mud:
    >
    > > steven wrote
    > >> > >>I see many sites that display a date in the format of 02/03/04.

    Which
    > >> > >>number is the year, month and day? Who knows.

    > >
    > >> You do? I think it could be any one of

    > > ...
    > >> February 3, 2004.

    > > Only 4% of the worlds population would have thought this :)
    > >

    >
    > Do you have documentation to backup that number?


    Sorry, type there. I meant to say less than 5%. This is assuming that the
    only people who use mdy are those in the U S of A.

    On checking my windows regional settings I find that there are a few other
    small countries that use mdy as well, Simbabwe, panama, swaziland, the
    phillipines (not so small at 75 million). Adding all these in as well we
    find that about 6.2% of the world use mdy. The rest use either ddmmyyyy or
    yyyymmdd.

    The raw numbers can be found here:

    http://esa.un.org/unpp/
    rf, Dec 11, 2004
    #15
  16. ted

    steven Guest

    "rf" <rf@.invalid> wrote in message
    news:0Krud.67804$...
    > Duende wrote:
    > > While sitting in a puddle rf scribbled in the mud:
    > >
    > > > steven wrote
    > > >> > >>I see many sites that display a date in the format of 02/03/04.

    > Which
    > > >> > >>number is the year, month and day? Who knows.
    > > >
    > > >> You do? I think it could be any one of
    > > > ...
    > > >> February 3, 2004.
    > > > Only 4% of the worlds population would have thought this :)
    > > >


    I never thought of it, but you're absolutely right!


    > >
    > > Do you have documentation to backup that number?

    >
    > Sorry, type there. I meant to say less than 5%. This is assuming that the
    > only people who use mdy are those in the U S of A.
    >
    > On checking my windows regional settings I find that there are a few other
    > small countries that use mdy as well, Simbabwe, panama, swaziland, the
    > phillipines (not so small at 75 million). Adding all these in as well we
    > find that about 6.2% of the world use mdy. The rest use either ddmmyyyy or
    > yyyymmdd.
    >
    > The raw numbers can be found here:
    >
    > http://esa.un.org/unpp/
    >


    Now that's an interesting site. I've been looking for this information for
    ages. Thanks.
    steven, Dec 11, 2004
    #16
  17. ted

    Duende Guest

    While sitting in a puddle rf scribbled in the mud:

    > Duende wrote:
    >> While sitting in a puddle rf scribbled in the mud:
    >>
    >> > steven wrote
    >> >> > >>I see many sites that display a date in the format of 02/03/04.

    > Which
    >> >> > >>number is the year, month and day? Who knows.
    >> >
    >> >> You do? I think it could be any one of
    >> > ...
    >> >> February 3, 2004.
    >> > Only 4% of the worlds population would have thought this :)
    >> >

    >>
    >> Do you have documentation to backup that number?

    >
    > Sorry, type there. I meant to say less than 5%. This is assuming that
    > the only people who use mdy are those in the U S of A.
    >
    > On checking my windows regional settings I find that there are a few
    > other small countries that use mdy as well, Simbabwe, panama, swaziland,
    > the phillipines (not so small at 75 million). Adding all these in as
    > well we find that about 6.2% of the world use mdy. The rest use either
    > ddmmyyyy or yyyymmdd.
    >
    > The raw numbers can be found here:
    >
    > http://esa.un.org/unpp/
    >
    >
    >


    I use ddmmyy

    --
    Mr. D?
    Never trust a cat to do a dog's job.
    Duende, Dec 11, 2004
    #17
  18. ted

    steven Guest

    "Neal" <> wrote in message
    news:eek:...
    > steven:
    > > Neal:
    > >> Never heard of a workable method.

    > >
    > > Like ISO8601, you mean?

    >
    > Outside of technical uses, it's not particularly useful to the average
    > Joe. Average Joe has not read ISO 8601, and he wants a more human-readable
    > format than that. Also, there is no guarantee that 2004-12-10 cannot be
    > mistaken for October 12, 2004 by individuals unaware of the ISO standard.
    >
    > Essentially, unless you and your reader both know a standard, the standard
    > is not worth using, especially if there's an even better way.


    That goes for every standard, and I'm trying to let the reader know.

    >
    > >> Best practice - state month explicitly,
    > >> state year in full form. Use your correct local format.
    > >>
    > >> 04 March 2002
    > >> March 4, 2002
    > >> etc

    > >
    > > Nah. You don't want to do that.

    >
    > Why? Is it ambiguous in the least? This method has the least chance of
    > being misinterpreted, slightly less even than the ISO standard.


    It's also language-dependent. How about 9 srpen 2004 or listopad 15, 2002?
    By gad! Listopad 15 looks more like a street address.
    David noted that you have to know the language anyway to be able to read the
    document. Suppose you get (lists of) dates from overseas contacts and you
    have to merge them with your own information.
    ISO8601 is language independent.
    And talking of lists: if you sort ISO8601 dates alphabetically, they're
    automagically sorted chronologically as well.
    ISO8601 has a fixed length and is shorter than date formats which use the
    month name in it. (yes, alright, "2 May 2004" is just as short, but that
    goes just for 9 days a year).
    steven, Dec 11, 2004
    #18
  19. ted

    steven Guest

    "steven" <> wrote in message
    news:Hywud.16985$-ops.be...
    >
    >
    > That goes for every standard, and I'm trying to let the reader know.
    >
    > >
    > > >> Best practice - state month explicitly,
    > > >> state year in full form. Use your correct local format.
    > > >>
    > > >> 04 March 2002
    > > >> March 4, 2002
    > > >> etc
    > > >
    > > > Nah. You don't want to do that.

    > >
    > > Why? Is it ambiguous in the least? This method has the least chance of
    > > being misinterpreted, slightly less even than the ISO standard.

    >
    > It's also language-dependent. How about 9 srpen 2004 or listopad 15, 2002?
    > By gad! Listopad 15 looks more like a street address.
    > David noted that you have to know the language anyway to be able to read

    the
    > document. Suppose you get (lists of) dates from overseas contacts and you
    > have to merge them with your own information.
    > ISO8601 is language independent.
    > And talking of lists: if you sort ISO8601 dates alphabetically, they're
    > automagically sorted chronologically as well.
    > ISO8601 has a fixed length and is shorter than date formats which use the
    > month name in it. (yes, alright, "2 May 2004" is just as short, but that
    > goes just for 9 days a year).
    >
    >


    BTW, I found srpen and listopad in Ronald Kyrmse's list of month names
    (http://www.geocities.com/kyrmse/Mesemana_2.0.pdf), dated 2003-11-26 :)
    steven, Dec 11, 2004
    #19
  20. ted

    steven Guest

    "Duende" <> wrote in message
    news:...
    > While sitting in a puddle rf scribbled in the mud:
    >
    > > Duende wrote:
    > >> While sitting in a puddle rf scribbled in the mud:
    > >>
    > >> > steven wrote
    > >> >> > >>I see many sites that display a date in the format of 02/03/04.

    > > Which
    > >> >> > >>number is the year, month and day? Who knows.
    > >> >
    > >> >> You do? I think it could be any one of
    > >> > ...
    > >> >> February 3, 2004.
    > >> > Only 4% of the worlds population would have thought this :)
    > >> >
    > >>
    > >> Do you have documentation to backup that number?

    > >
    > > Sorry, type there. I meant to say less than 5%. This is assuming that
    > > the only people who use mdy are those in the U S of A.
    > >
    > > On checking my windows regional settings I find that there are a few
    > > other small countries that use mdy as well, Simbabwe, panama, swaziland,
    > > the phillipines (not so small at 75 million). Adding all these in as
    > > well we find that about 6.2% of the world use mdy. The rest use either
    > > ddmmyyyy or yyyymmdd.
    > >
    > > The raw numbers can be found here:
    > >
    > > http://esa.un.org/unpp/
    > >
    > >
    > >

    >
    > I use ddmmyy
    >


    If everybody would have used ISO8601 there would never have been a Y2K
    problem. Mind you, even with ISO8601 we'll have a Y10K problem, but I guess
    that mankind will have other things on its mind before we reach that date.
    steven, Dec 11, 2004
    #20
    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. David Lozzi

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

    David Lozzi, Sep 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    839
    Rob Schieber
    Sep 30, 2005
  2. Lionel Neo

    Display html on another computer instead of local computer

    Lionel Neo, Oct 11, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    217
    Robert Koritnik
    Oct 11, 2004
  3. PW

    Dates! Dates! Dates!

    PW, Aug 7, 2004, in forum: ASP General
    Replies:
    4
    Views:
    172
    Mark Schupp
    Aug 9, 2004
  4. Replies:
    1
    Views:
    192
    Jano Svitok
    Jul 17, 2007
  5. Bart Van der Donck

    Consistent ps/top output format

    Bart Van der Donck, Aug 16, 2010, in forum: Perl Misc
    Replies:
    3
    Views:
    158
    J. Gleixner
    Aug 16, 2010
Loading...

Share This Page