> hi, I 'm new developer in php
> I always need to get the date or time from mysql ,and dead it in php,but I
> found it defficult to deal mysql date type string in php. mysql date type
> string always like "yyyy-mm-dd",in php4.06 I can use strtotime fuction
> convert it to unixtimestamp,but in php4.0 ,strtotime des not work.I don't
> know why?
> And I want to know about how to deal date type string (speciall like
> "yyyy-mm-dd") in php , and how to add days in date type string and so
> on.Could you introduce me some good code sample or good link about deal
> datetime in php.

MySQL can do this work for you.

ie.  select UNIX_TIMESTAMP(column_name) from table ...

There are also ways to add intervals and many other things directly in
MySQL.  However once you have it converted to a unix timestamp doing
date-math in PHP is trivial in that you just add the appropriate number of
seconds to the timestamp.

Lots of info in the MySQL docs on this.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to