|
|
 |
Re: FN-FORUM: date compare
date posted 19th August 2003 13:40
Thanks. I am in the middle of chopping out the hythens at the moment but you
are right I had forgotten that a string compare will work aswell.
Pam
----- Original Message -----
From: "Nick Grimshaw" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Tuesday, August 19, 2003 2:06 PM
Subject: RE: FN-FORUM: date compare
>
> Pam:
> > I have two dates in the format yyyy-mm-dd. Is there an easy way to test
if
> > one is earlier than the other or do I have to split then and compare the
> > year, month and day seperately.
>
> The reason ISO dates are so nice to work with is that they are *so* easy
to
> compare. If your language does 'sensible' string comparisons, then just
> compare them as strings. Alternatively, just chop out the hyphens, and
> compare them as numbers.
>
> Pause to think about it for a second, and you'll see that if the date
'gets
> later', so the number/string 'gets larger'.
>
> - Nick Grimshaw
> { if you're not part of the solution, you're part of the precipitate. }
>
>
> ==========
> redmail.com - webmail with a difference!
> 10Mb for just GBP 9.99 a year. Launch special 1Gb for GBP 99.99 a year
> IMAP, POP3, Spam Filtering and Anti Virus as standard.
> Visit http://www.redmail.com/?fl-signup to join.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|