RE: [PHP] Date problem!

From: Date: Mon, 11 Sep 2000 13:56:45 +0000
Subject: RE: [PHP] Date problem!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-16178@lists.php.net to get a copy of this message
> -----Original Message----- > From: manohar sadhasivam [mailto:sadhasivammanohar@hotmail.com] > Sent: Monday, September 11, 2000 2:08 PM > To: php-general@lists.php.net > Subject: [PHP] Date problem! > > > when i try to use this , it returns the current date instead of the given > one. > $tes="20000214"; > echo date("d:m:Y",time($tes)); Well, for starters the time() function returns the *current* unix timestamp. (See http://www.php.net/manual/function.time.php) For what you're trying to do, I believe you'll want mktime (http://www.php.net/manual/function.mktime.php). (Note, though, that you'll need to assemble it a little differently from what you're doing now. There's some sample code on that page in the manual that should get you through.) --- Mark Roedel | "Blessed is he who has learned to laugh Systems Programmer | at himself, for he shall never cease LeTourneau University | to be entertained." Longview, Texas, USA | -- John Powell

« previous php.general (#16178) next »