RE: [PHP] Difficulties with datetime

From: Date: Tue, 05 Dec 2000 23:25:50 +0000
Subject: RE: [PHP] Difficulties with datetime
Groups: php.general 
Request: Send a blank email to php-general+get-28778@lists.php.net to get a copy of this message
If the database accepts the state of NULL as the time and promotes it to midnight, there is no way to tell if the time was specified or if the time really was midnight. This is why we validate data entry. Garbage in (do a little datatype promotion), garbage out. Anthony -----Original Message----- From: Siim Einfeldt aka Itpunk [mailto:siim_e@pshg.edu.ee] Sent: Tuesday, December 05, 2000 1:59 PM To: php_uk@egroups.com; php-general@lists.php.net Subject: [PHP] Difficulties with datetime SELECT DATE_FORMAT(col,'%H:%i') miski /.../ <- that`s in mysql as the date&time is in the datetime column, the default value is 0000-00-00 00:00:00 If I want to know whether the time has been specified, then I do something like this: if($miski == ""){ echo "thetime hasn`t been entered"; } But what if the time was 00:00 (midnight)!? How can I make difference then whether the time is midnight or it isn`t specified at all? Thanks Siim EInfeldt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#28778) next »