It looks like it's in now() format, but without the punctuation.  The line
from your insert statement is 

20030323225645

If we break this apart, we see:

Year = 2003
Month = 03
Date = 23
Hour = 22 (or 10pm)
Minute 56
Seconds 45

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?

-ms




-----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]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to