Dates before 1970 - PHP
This is a discussion on Dates before 1970 - PHP ; Hello,
I have a project that deals with the date time stamps since 1900 (and
past), any suggestions about a good class that handles Date Time
Format before 1970. I really like date() function and want something
similar.
Thanks in ...
-
Dates before 1970
Hello,
I have a project that deals with the date time stamps since 1900 (and
past), any suggestions about a good class that handles Date Time
Format before 1970. I really like date() function and want something
similar.
Thanks in advance!
SP
-
Re: [PHP] Dates before 1970
Suhas wrote:
> Hello,
>
> I have a project that deals with the date time stamps since 1900 (and
> past), any suggestions about a good class that handles Date Time
> Format before 1970. I really like date() function and want something
> similar.
date() uses Unix timestamps which on most Unix platforms goes from
-MAX_INT to MAX_INT which means the date range is actually
12:45:52 12/13/1901 to 07:14:07 01/18/2038. So you might be able to get
away with it.
You can check it with:
echo date("h:i:s m/d/Y",-2147483648);
echo date("h:i:s m/d/Y", 2147483647);
Windows, not being Unix, doesn't understand that the timestamp can be
negative, although I think someone fixed that in PHP 5. In my 11+ years
of PHP I have yet to run PHP on Windows, so I wouldn't know.
-Rasmus
-
Re: [PHP] Dates before 1970
This will definitely solve one way but still other is there,
How to get that -ve number which starts at 1/1/1900 at 00:00 AM = 0
I need to be able to convert back and forth as there are some
calculations to be done on date field,
But this is very interesting..
Thx
SP
On 4/13/06, Rasmus Lerdorf <rasmus@lerdorf.com> wrote:
> Suhas wrote:
> > Hello,
> >
> > I have a project that deals with the date time stamps since 1900 (and
> > past), any suggestions about a good class that handles Date Time
> > Format before 1970. I really like date() function and want something
> > similar.
>
> date() uses Unix timestamps which on most Unix platforms goes from
> -MAX_INT to MAX_INT which means the date range is actually
> 12:45:52 12/13/1901 to 07:14:07 01/18/2038. So you might be able to get
> away with it.
>
> You can check it with:
>
> echo date("h:i:s m/d/Y",-2147483648);
> echo date("h:i:s m/d/Y", 2147483647);
>
> Windows, not being Unix, doesn't understand that the timestamp can be
> negative, although I think someone fixed that in PHP 5. In my 11+ years
> of PHP I have yet to run PHP on Windows, so I wouldn't know.
>
> -Rasmus
>
--
Contact @
Suhas Pharkute.
208 830 8915 (C)
208 429 6943 (H)
-
Re: [PHP] Dates before 1970
> I have a project that deals with the date time stamps since 1900 (and
> past), any suggestions about a good class that handles Date Time
> Format before 1970. I really like date() function and want something
> similar.
If you're using a database at all, most of them will handle any sort of dates.
--
Postgresql & php tutorials
http://www.designmagick.com/
-
Re: [PHP] Dates before 1970
Call me crazy, but I think that:
$time = 0xffffffff; //largest INT possible
echo date('m/d/Y h:i:s a', $time);
would be very revealing.
On Thu, April 13, 2006 10:26 pm, Suhas wrote:
> This will definitely solve one way but still other is there,
> How to get that -ve number which starts at 1/1/1900 at 00:00 AM = 0
>
> I need to be able to convert back and forth as there are some
> calculations to be done on date field,
>
> But this is very interesting..
> Thx
> SP
>
> On 4/13/06, Rasmus Lerdorf <rasmus@lerdorf.com> wrote:
>> Suhas wrote:
>> > Hello,
>> >
>> > I have a project that deals with the date time stamps since 1900
>> (and
>> > past), any suggestions about a good class that handles Date Time
>> > Format before 1970. I really like date() function and want
>> something
>> > similar.
>>
>> date() uses Unix timestamps which on most Unix platforms goes from
>> -MAX_INT to MAX_INT which means the date range is actually
>> 12:45:52 12/13/1901 to 07:14:07 01/18/2038. So you might be able to
>> get
>> away with it.
>>
>> You can check it with:
>>
>> echo date("h:i:s m/d/Y",-2147483648);
>> echo date("h:i:s m/d/Y", 2147483647);
>>
>> Windows, not being Unix, doesn't understand that the timestamp can
>> be
>> negative, although I think someone fixed that in PHP 5. In my 11+
>> years
>> of PHP I have yet to run PHP on Windows, so I wouldn't know.
>>
>> -Rasmus
>>
>
>
> --
> Contact @
> Suhas Pharkute.
> 208 830 8915 (C)
> 208 429 6943 (H)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Like Music?
http://l-i-e.com/artists.htm
-
Re: [PHP] Dates before 1970
>At 6:43 PM -0500 4/17/06, Richard Lynch wrote:
>Call me crazy, but I think that:
>
>$time = 0xffffffff; //largest INT possible
>echo date('m/d/Y h:i:s a', $time);
>
>would be very revealing.
Hmmmm.
Is: 12/31/1969 06:59:59 pm
Yes, it is -- I remember what I was doing then. It was six months
after I got out of the US Army.
And,
$time = -0xffffffff; //smallest INT possible
echo date('m/d/Y h:i:s a', $time);
Is: 12/13/1901 03:45:52 pm
Close to when I was born. :-)
Whereas,
$time = 0;
echo date('m/d/Y h:i:s a', $time);
Is: 12/31/1969 07:00:00 pm
But, what point is there in all this?
tedd
--
--------------------------------------------------------------------------------
http://sperling.com