sureshp Posted March 24, 2008 Share Posted March 24, 2008 Hi All, Anyone know why PHP handles date & time only from 1970 and above? Is there any special reasons & is it a drawback? Or do all programming languages do like this? Expecting replies. Thanks, Suresh P Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/ Share on other sites More sharing options...
rhodesa Posted March 24, 2008 Share Posted March 24, 2008 It's called Epoch Time: http://en.wikipedia.org/wiki/Unix_time Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-499786 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 its not "php" its the UNIX epoch which is the start of dating in computer systems Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-499787 Share on other sites More sharing options...
Barand Posted March 24, 2008 Share Posted March 24, 2008 Anyone know why PHP handles date & time only from 1970 and above? Not true. It handles my date of birth OK <?php $datetime = strtotime ('1949-01-22'); echo date ('l jS F, Y', $datetime); // Saturday 22nd January, 1949 ?> Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-499793 Share on other sites More sharing options...
rhodesa Posted March 24, 2008 Share Posted March 24, 2008 Yeah, should have touched on that too. It's just a reference point, not a limitation. Dates before that are just negative. I would test my birthday for you, but it's not in the negatives Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-499796 Share on other sites More sharing options...
Barand Posted March 24, 2008 Share Posted March 24, 2008 I would test my birthday for you, but it's not in the negatives Your time will come ..... Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-499946 Share on other sites More sharing options...
therealwesfoster Posted March 25, 2008 Share Posted March 25, 2008 By 3:14 AM on January 19, 2038, the UNIX timestamp will no be functional anymore. Google it, I'm serious Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500002 Share on other sites More sharing options...
cooldude832 Posted March 25, 2008 Share Posted March 25, 2008 I would test my birthday for you, but it's not in the negatives Your time will come ..... OMG i found a point barand is wrong on because his birthday will never go negative in UNIX timestamp I need to have a party now Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500008 Share on other sites More sharing options...
Stooney Posted March 25, 2008 Share Posted March 25, 2008 I would test my birthday for you, but it's not in the negatives Your time will come ..... OMG i found a point barand is wrong on because his birthday will never go negative in UNIX timestamp I need to have a party now Nah, time travel is coming. Just wait. Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500030 Share on other sites More sharing options...
cooldude832 Posted March 25, 2008 Share Posted March 25, 2008 you can't say time traveling is coming for it it had been in event in the future we would have already seen the ramifications of it now and in the past. watch lost and learn Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500033 Share on other sites More sharing options...
Barand Posted March 25, 2008 Share Posted March 25, 2008 I would test my birthday for you, but it's not in the negatives Your time will come ..... OMG i found a point barand is wrong on because his birthday will never go negative in UNIX timestamp I need to have a party now In 2037 the unix epoch will need adjusting, (although I guess by then there won't be a 32 bit restriction and everything from the Big Bang will be positive). Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500040 Share on other sites More sharing options...
Barand Posted March 25, 2008 Share Posted March 25, 2008 you can't say time traveling is coming for it it had been in event in the future we would have already seen the ramifications of it now and in the past. watch lost and learn How do you know history hasn't been changed? Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500043 Share on other sites More sharing options...
cooldude832 Posted March 25, 2008 Share Posted March 25, 2008 because I wrote down something that If I ever time travel I will rewrite it to something else to check a secondary note written by my self in a secondary time travel trip that contains the wining number to the lotto the day after which I an expected to discovery letter A leading me to letter B. Although I wonder what my constant would be if I have time traveled. I wonder if php works as a constant (lost reference for those who don't get it) Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500045 Share on other sites More sharing options...
Barand Posted March 25, 2008 Share Posted March 25, 2008 Interesting that you think human history is centered on you Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500050 Share on other sites More sharing options...
cooldude832 Posted March 25, 2008 Share Posted March 25, 2008 Interesting that you think human history is centered on you No i just know if time travel existed it would of been discovered again after it was once discovered in the future because you would go back in time. Therefore time travel is possible in my life time and if it has happen I gave myself the memory to time travel already to remind my self. Link to comment https://forums.phpfreaks.com/topic/97675-why-php-handles-date-time-only-from-1970/#findComment-500051 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.