FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Putting it all together
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Storing dates [message #186278 is a reply to message #186274] Sun, 22 June 2014 19:52 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Sun, 22 Jun 2014 13:55:49 -0400, richard wrote:

> On Sun, 22 Jun 2014 16:47:36 +0200, Arno Welzel wrote:
>
>> Erick T. Barkhuis, 2014-06-22 10:03:
>>
>>> Arno Welzel:
>>>
>>>> 1967-09-12 for the 9. September of 1967 BTW: This is why ISO 8601 had
>>>> been invented
>>>
>>> If that's the case, I don't like ISO 8601.
>>
>> Of course it was just a typo and 1967-09-12 is for 12. September of
>> 1967 ;-)
>
> But how are us humans supposed to know which comes first? what if you
> see 1967-31-09?

If you know it's an iso 8601 date then you know that the first 4 digits
(1967) are the year, the next 2 digits (31) are the month and the last 2
digits (09) are the day number.

> if it read 1967-Sep-09 then there is no guessing is there?

1967-sep-09 is not an iso 8601 date.

Iso 8601 defines a date as:

[4 digit Year Number][-][2 digit Month Number][-][2 digit Day Number]

So if "1967-31-09" was valid in iso 8601 it would actually be
"1969-07-09" or the 9th of July 1969, because July 1969 is the 31st month
starting at January 1967.

The reason iso 8601 is good is that in the string form, iso 8601 dates
sort properly, ie ascending / descending string order is also ascending /
descending date order. If you don't understand this, you obviously don't
understand anything about string sorting either.

Oh right. You don't.

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: str_replace does not like empty quotes
Next Topic: SplFileObject always returns an extra "last" line -- why?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 16:23:19 GMT 2024

Total time taken to generate the page: 0.03583 seconds