RE: [PHP] Time Problem: always ten past xx
| From: | Jason | Date: | Tue, 06 Oct 2009 08:03:34 +0000 |
| Subject: | RE: [PHP] Time Problem: always ten past xx | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298632@lists.php.net to get a copy of this message | ||
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@gmail.com]
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] 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