Undefined PHP fonction strptime() in XAMPP 1.6.4 for Windows
Posted:
23. November 2007 17:35
by verozg
Dear all,
I have install the last XAMPP version 1.6.4 on Windows XP Pro.
The uses of the PHP function strptime() leads to an error as below:
Fatal error: Call to undefined function strptime() in ....
The PHP doc says that the strptime is available since (PHP 5 >= 5.1.0).
The phpinfo() tells me that the PHP Version 5.2.4 is installed within XAMPP version 1.6.4.
Does someone tell me what is the problem ?
Thanks
Posted:
23. November 2007 17:51
by Wiedmann
Does someone tell me what is the problem ?
You have not read the manual page for strptime()
http://de.php.net/manual/en/function.strptime.php
Posted:
03. December 2007 10:04
by verozg
Thanks you for your answer. I missed this "detail".
I was thinking that PHP was interoperable.
Do you know which function I could use to replace the function strptime(). I use this function to transform a date in timestamp, where the date is given by a day, expressed by a number between 1 and 366, a year and a time.
thanks in advance
Posted:
03. December 2007 10:20
by Wiedmann
I use this function to transform a date in timestamp
That's curious, because you can't use this function to do this. Even on *nix.
Maybe you are searching for strtotime(), mktime() or gmmktime()?
Posted:
03. December 2007 10:47
by verozg
I forgot some detail:
As I have a day expressed by a number between 1 and 366, I use strptime() to retrieve the day of the month (1-31) and the month 's number (0-11); Then I used the function
mktime with arguments given by the array resulting of the strptime() function.
Ex:
$result= strptime ('2007 192 0815','%Y %j %H%M');
$time=mktime($result[tm_hour],$result[tm_min],0,$result[tm_mon]+1,$result[tm_mday],2007))
In this case, how to replace strptime() in order to retrieve the day of the month (1-31) and the month 's number from a day expressed by a number between 1 and 366 ?
Thanks in advance