note 3480 modified in Date and Time functions by ronabop
| From: | ronabop@php.net | Date: | Sat, 26 Aug 2000 04:46:50 +0000 |
| Subject: | note 3480 modified in Date and Time functions by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3292@lists.php.net to get a copy of this message | ||
If you need to convert a string to a timestamp, versions 3.0.12 and up include strtotime($AString)
which uses a yacc-generated parser to generate a timestamp from your user input. It assumes that
times are broken up by ":", and that dates use the "/" delimiter and are entered
in American (MM/DD/YY) format. am/pm and 24 hour formats are accepted for times.
If the string passed to the function only indicates the time (for example, 12:00am) the timestamp
that is generated will contain that time, on the day that the timestamp was generated.
Dates without a time are assumed to be 12:00am. There may be odd behavior related to time-zones, as
under certain circumstances the creation of the date and the printing of the date may each assume
that the date is in UTC, causing a double correction.
http://www.php.net/manual/date-and-time-functions.php