Hello Don, Well, you're right ;) I change the column type to int & it just run perfect. Thanks to both of ya!
Monday, March 24, 2003, 5:21:35 AM, you wrote: DR> On 24-Mar-2003 Michael Shulman wrote: >> It looks like it's in now() format, but without the punctuation. The >> line >> from your insert statement is DR> Nope, that's a MySQL timestamp. DR> UNIX_TIMESTAMPS are # of seconds from the epoch (Jan 1 1970). DR> "nobody" <[EMAIL PROTECTED]> is trying to store an INT in a timestamp column and DR> probably clobbering his values. >> >> 20030323225645 >> >> If we break this apart, we see: >> >> Year = 2003 >> Month = 03 >> Date = 23 >> Hour = 22 (or 10pm) >> Minute 56 >> Seconds 45 >> DR> Nope, that's a MySQL timestamp. DR> UNIX_TIMESTAMPS are # of seconds since the epoch (Jan 1 1970). DR> nobody <[EMAIL PROTECTED]> is probably trying to store an INT in a timestamp DR> column and clobbering his values as the timestamp updates. >> Someone else on the list: where or how is the timezone encode, or this is >> entry in GMT? Is there a way to determine the local timezone on the >> machine? >> mysql>> show variables like 'timezone'; DR> +---------------+-------+ DR> | Variable_name | Value | DR> +---------------+-------+ DR> | timezone | PST | DR> +---------------+-------+ DR> 1 row in set (0.00 sec) mysql>> select sec_to_time((time_to_sec(now()) - UNIX_TIMESTAMP()) % 86400) DR> as 'offset GMT'; DR> +------------+ DR> | offset GMT | DR> +------------+ DR> | -08:00:00 | DR> +------------+ DR> 1 row in set (0.00 sec) >> >> -----Original Message----- >> From: nobody [mailto:[EMAIL PROTECTED] >> Sent: Sunday, March 23, 2003 12:56 PM >> To: [EMAIL PROTECTED] >> Subject: date problem >> >> Hello mysql, >> >> I do this: >> >> $query = "INSERT INTO news(ID, author, title, text, date) VALUES(NULL, >> '".$_SESSION["ulogged"]."', '".$title."', '".$text."', >> UNIX_TIMESTAMP(NOW()))"; >> $result = mysql_query($query, $connection) or die("problem with query"); >> >> I get this: >> >> mysql> select * from news where id='1'; >> +----+--------+----------+----------------------------+----------------+ >>| ID | author | title | text | date | >> +----+--------+----------+----------------------------+----------------+ >>| 1 | myuser | news | blah blah blah | 20030323225645 | >> +----+--------+----------+----------------------------+----------------+ >> 1 row in set (0.01 sec) >> >> Look at the time! It's set ... strange :) 2003 03 23 22 56 45 .. it's >> not neither now() format, neither unix_timestamp() format. >> >> mysql> select now(), unix_timestamp(now()); >> +---------------------+-----------------------+ >>| now() | unix_timestamp(now()) | >> +---------------------+-----------------------+ >>| 2003-03-23 23:07:30 | 1048453650 | >> +---------------------+-----------------------+ >> 1 row in set (0.01 sec) >> >> It's okay. So, why in the query from a php form the unix time date is >> saved wrong? Any ideas and suggestions? >> >> -- >> best wishes, >> Strahil Minev a.k.a. DLHelper, >> BuFu TeaM mailto:[EMAIL PROTECTED] >> DR> Regards, DR> -- DR> Don Read [EMAIL PROTECTED] DR> -- It's always darkest before the dawn. So if you are going to DR> steal the neighbor's newspaper, that's the time to do it. DR> (53kr33t w0rdz: sql table query) -- 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]