RE: Time Problem: always ten past xx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime 

HTH
J

-----Original Message-----
From: Matthias Laug [mailto:matthias.laug@xxxxxxxxx] 
Sent: 06 October 2009 08:53
To: php-general@xxxxxxxxxxxxx
Subject:  Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date  
and time.

So I get for example "10:30" and "06.10.2009". Standard german time  
format. Now I try to get the correct timestamp:

$time = strtotime("06.10.2009 10:30");
var_dump($time);
var_dump(strftime("%d.%m.%Y %H:%m",$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always "10", no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux