Posted by Aggelos on 10/23/06 20:12
> In PHP, you could use strtotime(), but if the data comes from a database I
> strongly recommend to let the database handle it.
> --
> Grtz,
>
> Rik Wasmus
The datetime in the database is stored from PHP using date(Y-m-d H:i:s)
so when I pull it from MySQL database
I am expecting to convert it from Datetime format to Unixtimestamp.
I found a function in PHP.net str2time it is in the second post from
the top
http://uk.php.net/manual/en/function.mktime.php#67996
Thats how I do it now.
But I don't understand what can be different in PHP from MySQL built in
function.
All they have to do is add seconds since 1/1/1970 plus the current time
seconds.
Thanks for your post anyway. :)
Navigation:
[Reply to this message]
|