jimmy_B Posted January 6, 2007 Share Posted January 6, 2007 Hi,mktime returns date in UNIXTIMESTAMP format & it's 10 digit long.I just want to know that Is UNIXTIMESTAMP is always 10 digit long or it can be less than 10 digits or more than digits in other cases.Thanks in advance for your consideration :)Jimmy Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/ Share on other sites More sharing options...
hvle Posted January 6, 2007 Share Posted January 6, 2007 if your PHP running on windows, timestamp ranged from 0 to 2147483648 Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154098 Share on other sites More sharing options...
corbin Posted January 6, 2007 Share Posted January 6, 2007 Can I ask why the timestamp maxes at Jan 18, 2038 9:14:07PM?(PS yes, I did actually check it lol) Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154100 Share on other sites More sharing options...
brendandonhue Posted January 6, 2007 Share Posted January 6, 2007 You'll run into an integer overflow at the point. Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154105 Share on other sites More sharing options...
corbin Posted January 6, 2007 Share Posted January 6, 2007 Ooooohhhh, that finally explains something about a game I play... LolThanks for the answer :p Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154107 Share on other sites More sharing options...
alpine Posted January 6, 2007 Share Posted January 6, 2007 Yes it will be until january 18, 2038But then i guess the problem might be another... http://www.unixtimestamp.com Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154120 Share on other sites More sharing options...
hvle Posted January 6, 2007 Share Posted January 6, 2007 This is strange.max 32 bits int: 4294967296max/2 = 2147483648echo date('j-m-Y', 4294967295); // got errorecho date('j-m-Y', 2147483645); // 19-01-2038for any negative $n:echo date('j-m-Y', $n); // got errorecho date('j-m-Y', -680646); // errorIt 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 Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154171 Share on other sites More sharing options...
Daniel0 Posted January 6, 2007 Share Posted January 6, 2007 It can be longer or shorter depending on how many seconds it is since the UNIX epoch. Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154175 Share on other sites More sharing options...
Azu Posted January 6, 2007 Share Posted January 6, 2007 [quote author=hvle link=topic=121217.msg498110#msg498110 date=1168086740]This is strange.max 32 bits int: 4294967296max/2 = 2147483648echo date('j-m-Y', 4294967295); // got errorecho date('j-m-Y', 2147483645); // 19-01-2038for any negative $n:echo date('j-m-Y', $n); // got errorecho date('j-m-Y', -680646); // errorIt 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..? :-\ Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154195 Share on other sites More sharing options...
hvle Posted January 7, 2007 Share Posted January 7, 2007 has anybody tried it?I'm using Windows XP.[code]<?phpecho 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 3is my windows screwed up or what? Quote Link to comment https://forums.phpfreaks.com/topic/33065-unixtimestamp-is-it-always-10-digit-long/#findComment-154822 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.