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

Home » Imported messages » comp.lang.php » comparing dates?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: comparing dates? [message #175502 is a reply to message #175493] Mon, 03 October 2011 04:54 Go to previous messageGo to previous message
gordonb.wr5h4 is currently offline  gordonb.wr5h4
Messages: 1
Registered: October 2011
Karma:
Junior Member
>> I need to know if a date (say 10/03/2011) is before another date in
>> the same format. Direct comparison doesn't work.
>
> Direct comparison certainly does work, as long as you have it formatted
> as year-month-day.

Careful.

"2011-10-03" compares less than "2011-3-7" if you use a straight
string comparison.

If you require a sufficient number of leading zeroes, and a consistent
separator, it will work OK. But it's also likely to have a Y10K
problem.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: simple image in PHP
Next Topic: Question about new lines
Goto Forum:
  

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

Current Time: Sat Nov 23 00:17:26 GMT 2024

Total time taken to generate the page: 3.74692 seconds