The result of strptime() is not affected by the current timezone setting, even though strftime() is. Tested in PHP 5.1.6.
![]() |
|
||||||||||
|
strptimeОписаниеarray strptime ( string date, string format )
strptime() returns an array with the
Month and weekday names and other language dependent strings respect the current locale set with setlocale() (LC_TIME).
Список параметров
Возвращаемые значенияReturns an array, or FALSE on failure.
Таблица 1. The following parameters are returned in the array
Примеры
strptime
chad 0x40 herballure 0x2e com
15-Jun-2007 07:00
The result of strptime() is not affected by the current timezone setting, even though strftime() is. Tested in PHP 5.1.6.
svenr at selfhtml dot org
23-Nov-2006 01:44
If you need strptime but are restricted to a php version which does not support it (windows or before PHP 5), note that MySQL since Version 4.1.1 offers (almost?) the same functionality with the STR_TO_DATE function.
DT <pwadas at gazeta dot pl>
10-Aug-2006 12:55
//This turns non-standard but often used "datetime" string
jojyjob at gmail dot com
13-May-2006 12:18
/***Finding the days of a week ***/
Malte Starostik
27-Mar-2006 10:45
It says "Parse a time/date generated with strftime()" but that's not entirely correct -- While strptime("2006131", "%Y%W%u") works as expected, strptime("2006131", "%G%V%u") returns false instead of reversing the equivalent - and unambiguous - strftime() usage. I suspect that's because glibc doesn't support that. Anyway, this docu page fails to mention that apparently not all format components supported by strftime() can be used with strptime().
|