Undefined PHP fonction strptime() in XAMPP 1.6.4 for Windows

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Undefined PHP fonction strptime() in XAMPP 1.6.4 for Windows

Postby verozg » 23. November 2007 17:35

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
verozg
 
Posts: 3
Joined: 23. November 2007 17:16

Postby Wiedmann » 23. November 2007 17:51

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
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby verozg » 03. December 2007 10:04

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
verozg
 
Posts: 3
Joined: 23. November 2007 17:16

Postby Wiedmann » 03. December 2007 10:20

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()?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby verozg » 03. December 2007 10:47

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
verozg
 
Posts: 3
Joined: 23. November 2007 17:16

Postby Wiedmann » 03. December 2007 11:06

Code: Select all
$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))

how to replace strptime()

Code: Select all
$time = strtotime('2007-01-01 08:15 +192 days');
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 143 guests