[thelist] Date and Time issue Worldwide

R.Livsey R.Livsey at cache-22.co.uk
Fri Apr 12 19:08:12 CDT 2002


> I need moral support on this one. I'm not necessarily trying
> to put a date into form field/database cell, I can do that.
> What time/date formats are globally acceptable?
>
> For example, Richard Livsey's Birth Day is
>
> 21/8/1981
>
> Americans might say:
>
> 8/21/1981
>
> Other's way, who knows. I've seen them all.
>
> BTW, Richard on your site: www.cache-22.co.uk/index_css.php
> interesting approach to web design. I never knew there was a
> Internet Fraud Complain Center. :-) funny

Heh - yeah I was wondering when I saw my name there - though "how'd he
know my birthday?!". Always forget I have that info freely available on
my site! :)
Cheers for spelling my name right too (everyone seems to spell it
Livesey like from Treasure Island! I think that spelling is more common
tho')

I store all date/time values in databases as Unix timestamps because you
can guarentee (I think) that you will be able to use them on any system
and because PHP has great facilities to deal with them. Although as
mentioned, they only go as far back as 1970, so if you need to work with
dates prior to that then you should use something else I suppose.

However when printing them things can get tricky as you say, although it
would be hard to get confused with the format of my birthday as above as
there is no 21'st month!
Dates like 01/02/03 are where it gets really confusing - which is the
month/day/year etc..

As mentioned the above would mean 2nd Jan 2003 in the US, whereas I
would assume it to mean 1st Feb 2003 over here in the UK.

Best way would be to explicitly print it like 1st Feb 2003, or 2nd Jan
2003 or whatever that one above means! No way to get confused there.

You could do the format displaying on the fly and let the user select
their desired format, then store it and the user always sees the dates
from their own viewpoint.

As a passing thought, when naming files so that they stack in date order
I store them as year-month-day as they then order themselves correctly!

HTH

--
R.Livsey




More information about the thelist mailing list