Re: date parsing

From: Date: Tue, 13 Sep 2005 18:06:38 +0000
Subject: Re: date parsing
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-222277@lists.php.net to get a copy of this message
Philippe Reynolds wrote:
Greetings all, I am trying to find a function or a way to parse a date that has the following format 2005124 or 20051204.
Well, the truth is, computers are stupid, and you need to explain this kind of date format to him by rewriting such date in a way that a computer can understand... From where do you get such string? Can you ask the "sender" to send more uniform/standard date?
I tried strtotime(%Y/%m/%d, "2005124") and this is the result: 1970/01/23.
Look again at the function definition http://www.php.net/strtotime The second argument is timestamp (number of seconds since the unix epoch). So if you count 2005124 seconds from January 1 1970 00:00:00 GMT you would get to January 23 1970. hope this will help you a little, N::

Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
« previous php.general (#222277) next »