Jump to content

UNIXTIMESTAMP - Is it always 10 Digit Long


jimmy_B

Recommended Posts

This is strange.

max 32 bits int: 4294967296

max/2 = 2147483648

echo date('j-m-Y', 4294967295); // got error

echo date('j-m-Y', 2147483645);  // 19-01-2038

for any negative $n:
echo date('j-m-Y', $n); // got error
echo date('j-m-Y', -680646);  // error

It look as the unix time went from 0 to 2147483647 which is only half of the range of 32 bits int, with Windows.
I don't understand this.  Perhap anyone can explain?
[quote author=hvle link=topic=121217.msg498110#msg498110 date=1168086740]
This is strange.

max 32 bits int: 4294967296

max/2 = 2147483648

echo date('j-m-Y', 4294967295); // got error

echo date('j-m-Y', 2147483645);  // 19-01-2038

for any negative $n:
echo date('j-m-Y', $n); // got error
echo date('j-m-Y', -680646);  // error

It look as the unix time went from 0 to 2147483647 which is only half of the range of 32 bits int, with Windows.
I don't understand this.  Perhap anyone can explain?
[/quote]
Maybe it's because it is a signed int? But then why are negative numbers giving an error..?  :-\
has anybody tried it?
I'm using Windows XP.

[code]<?php

echo date('j-m-Y', -680646);
?>
[/code]

error:
PHP Warning:  date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in E:\client\vnh\_debug_tmp.php on line 3


is my windows screwed up or what?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.