hello again!
thank you for the explanation.
The update statement - which I didn't test - is to convert your old db timestamp entries to your new datetime database field if you want to convert them.
well, fortunately I don't have to convert anything into timestamp, because they are already stored in the database.
If you want to eliminate the part which generates your unix-timestamp then you can use date() function of php http://www.php3.de/manual/en/function.date.php to convert the timestamp integer to the mySQL needed format "0000-00-00 00:00:00".
What I'm looking for is quite the opposite; I need the timestamp from the mySQL format, not the other way round.
I found the function strtotime()
-> int strtotime ( string time [, int now])
which is expected to convert datetime into unix-timestamp. But there the manual says that id does it (quote) "relative to the timestamp given in now"... but what does that mean?
if my date is "2002-09-05 00:00:01" how would the funktion look like to get the appropriate timestamp?
like this?: strtotime("2002-09-05 00:00:01", 0);?
if not, could you tell me the right syntax?
thank you a lot,
vince
PS:
You can also alter your query:
SELECT *,date_format(timestampdatefieldintable, '%Y-%m-%d %H:%i:%s') AS hand FROM table;
This is great ;-)