List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:October 1 1999 3:45pm
Subject:Re: Date routines
View as plain text  
On Fri, 1999-10-01 11:21:26 -0400, Stephen Johnston wrote:
> 	I am querying out of a database using this query ---->
> 
> /*--------------------*/
> 
> select fname, lname, midname, gender, yearofbirth, address, aptno, city, 
> state, zip, country, dayphone, eveningphone, fax, email, username, 
> password, membership, authcode, setupdate, mailinglist, active from user 
> where lname <> '' and setupdate between '9/29/99 00:00:00' and '9/30/99 
> 23:59:59'
> 
> /*------------------*/
> 
> and getting some weird data........
> 
> setupdate is a timestamp - the weird thing is that this query
> sometimes returns setupdates from 9/3/99 00:00:00 (time sometimes
> different)
[...]
> Note: I am actually not sure if the field is a datetime or a
> timestamp, but that should not matter right?

Right, _that_ doesn't matter ... ;)

But the only correct date/time formats are 'yyyy-mm-dd hh:mm:ss' as
string, e.g. '1999-09-30 23:59:59', or yyyymmddhhmmss as number, e.g.
19990930235959.
(It's possible to use '99' only for the year part, but who would be
 so careless to use short years with Y2K problems so well-known now?)

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=5244 5EF3 B0B1 3826  E4EC 8058 7B31 3AD7
Thread
Date routinesStephen Johnston1 Oct
  • Re: Date routinesMartin Ramsch1 Oct
  • RE: Date routinesbkline1 Oct
    • RE: Date routinesStephen Johnston1 Oct
      • RE: Date routinesBob Kline1 Oct
        • RE: Date routinesStephen Johnston2 Oct