RE: Time Problem: always ten past xx

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

 



Jason,

%M is also month:

Month --- ---
F A full textual representation of a month, such as January or March January through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31

Time --- ---
i Minutes with leading zeros 00 to 59

http://tr.php.net/manual/en/function.date.php



-----Original Message-----
From: Jason [mailto:networkadmin@xxxxxxxxxxxx]
Sent: Tuesday, October 06, 2009 11:04 AM
To: 'Matthias Laug'; php-general@xxxxxxxxxxxxx
Subject: RE:  Time Problem: always ten past xx

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



  ________________________________
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz ve mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili olarak ?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r. ?irketimiz mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan, b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system.

[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