Use the DateTime construct. See:
http://us3.php.net/manual/en/datetime.gettimestamp.php
On 6/27/11 5:26 PM, "ymnoor21" <ymnoor21@yahoo.com> wrote:
>Hi everyone,
>I was working with PHP's core date function and came across an
>interesting problem. Ex:
>
>echo date("m/d/Y", strtotime("2038-01-18"));
>prints: 01/18/2038
>
>but if you go beyond that date, then it goes back to this: 12/31/1969
>
>Looks like i've hit the wall. I knew that PHP had a setdate limitation
>for unix (1902 - 2037) & for windows (1971 - 2037). But my question was
>why it would show me a date of 2038 even though they are limited to year
>2037 by theory? Probably something to do with 32bit or 64bit issue.
>Anyway, i have to deal a workaround for setting future dates (ex:
>12/31/2111), unless if you guys have any solution using PHP's core date
>object / function.
>
>Please do let me know if you find this problem interesting & have a good
>solution for this.
>
>Thanks
>Yamin
>
>
>
>------------------------------------
>
>Visit phpXperts website at www.phpxperts.netYahoo! Groups Links
>
>
>
Monday, June 27, 2011
Re: [phpXperts] Interesting Problem!!!
__._,_.___
Visit phpXperts website at www.phpxperts.net
.
__,_._,___
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment