RE: [PHP] Hour/dates problems

From: Date: Thu, 11 Oct 2001 04:25:32 +0000
Subject: RE: [PHP] Hour/dates problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70655@lists.php.net to get a copy of this message
try this: <? $date = "25/12/2001 12:25:01"; list($dd,$mm,$yy,$hh,$mn,$ss) = split("[:/ ]",$date); $new_date = date("d/m/Y H:i",mktime($hh,$mn,$ss,$mm,$dd,$yy)); ?> or maybe just remove the last three character from the date string : <?php $date = "25/12/2001 12:25:01"; $new_date = substr($date,0,strlen($date)-3); ?> or maybe there are othe better ways of doing this. hope that helps! jessie :) -----Original Message----- From: KeaZ [mailto:phpbox@ifrance.com] Sent: Wednesday, October 10, 2001 5:55 AM To: php-general@lists.php.net Subject: [PHP] Hour/dates problems How to delete the seconds in a date ? (from dd/mm/YYYY H:i:S to dd/mm/YYYY H:i) Thanks

« previous php.general (#70655) next »