Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3295

Re: comparing dates?

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: comparing dates?
Date 2011-10-03 14:59 -0400
Organization A noiseless patient Spider
Message-ID <j6d0mj$csg$2@dont-email.me> (permalink)
References <o2og875gpttj3c9h6ilv93mosd88dbujqt@4ax.com> <j6a3ut$rga$1@dont-email.me> <zIqdnS_7npOS3RTTnZ2dnUVZ_oudnZ2d@posted.internetamerica> <j6cljm$r7s$1@dont-email.me>

Show all headers | View raw


On 10/3/2011 11:50 AM, Doug Miller wrote:
> On 10/3/2011 12:54 AM, Gordon Burditt wrote:
>>>> 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.
>
> But those aren't the same format.
>>
>> 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.
>
> I think it's a pretty safe bet that software developed today will not be
> in use 7989 years later.
>

I don't know, Doug.  That's what they said in the 60's about Yr2K.

Code doesn't become obsolete - it just keeps getting modified :)

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

comparing dates? Michael Joel <no@please.com> - 2011-10-02 09:00 -0400
  Re: comparing dates? houghi <houghi@houghi.org.invalid> - 2011-10-02 15:43 +0200
  Re: comparing dates? Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-02 09:58 -0400
  Re: comparing dates? Doug Miller <doug_at_milmacdotcom@example.com> - 2011-10-02 12:36 -0400
    Re: comparing dates? gordonb.wr5h4@burditt.org (Gordon Burditt) - 2011-10-02 23:54 -0500
      Re: comparing dates? Doug Miller <doug_at_milmacdotcom@example.com> - 2011-10-03 11:50 -0400
        Re: comparing dates? Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 14:59 -0400
  Re: comparing dates? bobm3@worthless.info - 2011-10-03 20:31 -0400
  Re: comparing dates? Michael Joel <no@please.com> - 2011-10-04 09:27 -0400
    Re: comparing dates? The Natural Philosopher <tnp@invalid.invalid> - 2011-10-04 15:43 +0100
  Re: comparing dates? "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-10-06 11:00 +0200

csiph-web