----- Original Message -----
From: <pandr@stripped>
To: <mysql@stripped>
Sent: Monday, November 15, 1999 6:52 AM
Subject: Bug in unix_timestamp()
> >Description:
>
> The unix_timestamp is not well-defined, i.e. it may return different
> values for same argument.
>
> >How-To-Repeat:
>
> select unix_timestamp('1999-10-31 01:59:59');
> select unix_timestamp('1999-10-31 02:00:00');
> select unix_timestamp('1999-10-31 03:00:00');
> select unix_timestamp('1999-10-31 02:00:00');
>
> yields
>
> 941327999
> 941328000
> 941335200
> 941331600 !!!!!
>
> Note, this is of course only a problem because of the daylight-saving.
>
Are you sure you meant for the 2nd and 4th example to be identical?
That result you're questioning is: from_unixtime(941331600): 1999-10-30
20:00:00
mysql> status
--------------
mysql Ver 9.32 Distrib 3.22.21, for pc-linux-gnu (i686)
mysql> select unix_timestamp('1999-10-31 01:59:59'),
unix_timestamp('1999-10-31 02:00:00'),unix_timestamp('1999-10-31 03:00:00'),
unix_timestamp('1999-10-31 02:00:00')
-> ego
*************************** 1. row ***************************
unix_timestamp('1999-10-31 01:59:59'): 941356799
unix_timestamp('1999-10-31 02:00:00'): 941356800
unix_timestamp('1999-10-31 03:00:00'): 941360400
unix_timestamp('1999-10-31 02:00:00'): 941356800
1 row in set (0.01 sec)
.... and:
mysql> status
--------------
mysql Ver 9.32 Distrib 3.22.23b, for pc-linux-gnu (i486)
mysql> select unix_timestamp('1999-10-31 01:59:59'),
unix_timestamp('1999-10-31 02:00:00'),unix_timestamp('1999-10-31 03:00:00'),
unix_timestamp('1999-10-31 02:00:00')
-> ego
*************************** 1. row ***************************
unix_timestamp('1999-10-31 01:59:59'): 941356799
unix_timestamp('1999-10-31 02:00:00'): 941356800
unix_timestamp('1999-10-31 03:00:00'): 941360400
unix_timestamp('1999-10-31 02:00:00'): 941356800
1 row in set (0.01 sec)
mysql> select from_unixtime(941356800);
+--------------------------+
| from_unixtime(941356800) |
+--------------------------+
| 1999-10-31 02:00:00 |
+--------------------------+
-Jay J