Re: mySQL time = year 2038 [HELP]

From: Date: Mon, 01 Jul 2002 22:37:30 +0000
Subject: Re: mySQL time = year 2038 [HELP]
Groups: php.general 
Request: Send a blank email to php-general+get-104810@lists.php.net to get a copy of this message
>Checked the archive and saw no difinitives... so... How come when I query >my clients mySQL DB and use NULL or NOW() as my default in a TIMESTAMP >record that it always comes up Jan 18, 2038? > >Is the clock not set properly, or am I misunderstanding some basic >principal of the time stamp? > >My clients version pf PHP is 4+ on a Windows IIS server. Show us some source code... 2038 is the "end of time" for Unix timestamps on 32-bit hardware. In other words, if you take 0xFFFFFFFF, that 2 billion number that's the biggest signed integer you can get with 32 bits, and you try to turn that into a date/time, you'll get something in March of 2038, which is 2 billion seconds after JANUARY 1st, 1970, midnight (GMT), which is "0" time. Most likely, you are somehow convincing MySQL and/or PHP to use some number very close to 0xFFFFFFFF and convert that to a time stamp... -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#104810) next »