RE: [PHP] PHP and mySQL dates

From: Date: Wed, 13 Sep 2006 11:09:29 +0000
Subject: RE: [PHP] PHP and mySQL dates
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-241702@lists.php.net to get a copy of this message
[snip] Hi all. I am building an online events registry and have mapped out all the dates between Oct 1 2006 and Dec 31 2030, stored in the database as timestamps incremented by 86400 to give daily slots. [/snip] I do not really understand the purpose of mapping all dates between Oct 1 2006 and Dec 31 2030 and store them into a database as a timestamp. First of all, a date is a date, not a timestamp. A timestamp is date and time together. Why don't you just save the events with the date as DATE format and then compare them with CURDATE() or similar. Or just with "$_SESSION[year]- "$_SESSION[month]- "$_SESSION[day]" Just some thoughts. /Peter

« previous php.general (#241702) next »