Date/Time is such a tricky thing. I think that's we migrated toward the simplest solution in the first place.
For days/weeks/months, I think the math cited below works pretty well. That is, if we're not talking about calendar months. As soon as we need to query based on calendar things, we tend to get the start and end epoch times from something like Perl's Time::ParseDate, which is fluent in the madness that is the Gregorian calendar, and query against such limits. Cheers. -Dana > -----Original Message----- > From: Michael T. Babcock [SMTP:[EMAIL PROTECTED]] > Sent: Monday, December 23, 2002 10:57 AM > To: [EMAIL PROTECTED] > Cc: Dana Diederich; 'Keith C. Ivey'; [EMAIL PROTECTED]; Akash > Subject: Re: What, if anything, is wrong with UNIX Epoch time stamps? > [Was: R E: TimeStamp in MySQL reqd NULL] > > Csongor Fagyal wrote: > > > Oh and one more thing I am not really sure of: sometimes defining the > > day as 3600*24 or the year as 3600*24*365 is not the best idea... just > > think about leap years. How do you handle that? And there are some > > more "artifacts" in the Gregorian calendar, too... > > > But MySQL doesn't guarantee correctness in time values in the first > place. You can still insert "2002-02-31" as a date if you like: > > mysql> create table temp (date datetime); > Query OK, 0 rows affected > > mysql> insert into temp(date) values ("2002-02-31"); > Query OK, 1 row affected > > mysql> select * from temp; > +---------------------+ > | date | > +---------------------+ > | 2002-02-31 00:00:00 | > +---------------------+ > 1 row in set > > -- > Michael T. Babcock > C.T.O., FibreSpeed Ltd. > http://www.fibrespeed.net/~mbabcock > ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error destroy it immediately. ********************************************************************** Wal-Mart Stores, Inc. Confidential ********************************************************************** --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php