Hello Michael, The most interesting part is that it's not in NOW() format! I've tried one-two times the same query and:
mysql> select * from news; +----+--------+--------------+-----------------------------------------+----------------+ | ID | author | title | text | date | +----+--------+--------------+-----------------------------------------+----------------+ | 1 | myuser | news | blah blah blah | 20030323225645 | | 2 | myuser | news2 | yakidi shmakidi | 20001117212520 | | 3 | myuser | news3 | this ain't fun | 20001118212554 | +----+--------+--------------+-----------------------------------------+----------------+ 3 rows in set (0.02 sec) It's just.. random.. I don't know, is this a bug or something? [EMAIL PROTECTED]:/www/voting/vega$ date Mon Mar 24 04:36:33 EET 2003 My clock is okay. Monday, March 24, 2003, 4:03:45 AM, you wrote: MS> It looks like it's in now() format, but without the punctuation. The line MS> from your insert statement is MS> 20030323225645 MS> If we break this apart, we see: MS> Year = 2003 MS> Month = 03 MS> Date = 23 MS> Hour = 22 (or 10pm) MS> Minute 56 MS> Seconds 45 MS> Someone else on the list: where or how is the timezone encode, or this is MS> entry in GMT? Is there a way to determine the local timezone on the machine? MS> -ms MS> -----Original Message----- MS> From: nobody [mailto:[EMAIL PROTECTED] MS> Sent: Sunday, March 23, 2003 12:56 PM MS> To: [EMAIL PROTECTED] MS> Subject: date problem MS> Hello mysql, MS> I do this: MS> $query = "INSERT INTO news(ID, author, title, text, date) VALUES(NULL, MS> '".$_SESSION["ulogged"]."', '".$title."', '".$text."', MS> UNIX_TIMESTAMP(NOW()))"; MS> $result = mysql_query($query, $connection) or die("problem with query"); MS> I get this: mysql>> select * from news where id='1'; MS> +----+--------+----------+----------------------------+----------------+ MS> | ID | author | title | text | date | MS> +----+--------+----------+----------------------------+----------------+ MS> | 1 | myuser | news | blah blah blah | 20030323225645 | MS> +----+--------+----------+----------------------------+----------------+ MS> 1 row in set (0.01 sec) MS> Look at the time! It's set ... strange :) 2003 03 23 22 56 45 .. it's MS> not neither now() format, neither unix_timestamp() format. mysql>> select now(), unix_timestamp(now()); MS> +---------------------+-----------------------+ MS> | now() | unix_timestamp(now()) | MS> +---------------------+-----------------------+ MS> | 2003-03-23 23:07:30 | 1048453650 | MS> +---------------------+-----------------------+ MS> 1 row in set (0.01 sec) MS> It's okay. So, why in the query from a php form the unix time date is MS> saved wrong? Any ideas and suggestions? MS> -- MS> best wishes, MS> Strahil Minev a.k.a. DLHelper, MS> BuFu TeaM mailto:[EMAIL PROTECTED] -- best wishes, Strahil Minev a.k.a. DLHelper, [EMAIL PROTECTED], BuFu TeaM mailto:[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]