[PHP] Re: Time/date function MYSQL-UNIX

2002-05-24 Thread Hugh Bothwell


Peter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there a built in PHP function which will convert a MySQL type date
 (DDMM or whatever) into a unix timestamp so it can be used with the
 other PHP time and date functions?

 I'm currently using substr() to extract bits of the date so it displays as
 DD / MM /  but it's annoying!


SELECT
id, UNIX_TIMESTAMP(mydate) AS mydatestamp
FROM mytable

then  $row['mydatestamp'] is your unix timestamp.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Time/date function MYSQL-UNIX

2002-05-24 Thread Peter

OK cheers. I'll have a try.
I saw UNIX_TIMESTAMP() in the MySQL docs but I didn't quite understand it
(PHP is MUCH easier for me!)
Thanks for the example too


Peter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there a built in PHP function which will convert a MySQL type date
 (DDMM or whatever) into a unix timestamp so it can be used with the
 other PHP time and date functions?

 I'm currently using substr() to extract bits of the date so it displays as
 DD / MM /  but it's annoying!





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php