Re: Date problem!

From: Date: Mon, 11 Sep 2000 18:57:30 +0000
Subject: Re: Date problem!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-16208@lists.php.net to get a copy of this message
On Mon, 11 Sep 2000, manohar sadhasivam wrote: > Hi, > 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)); > > According to the doc, the "time()" function does NOT take any parameters and always returns the current date&time. If you want to convert $tes into a date, you could do something like: $year=substr($tes,1,4); $mon=substr($tes,5,2); $day=substr($tes,6,2); $date=mktime(0,0,0,$mon,$day,$year); print date("d:m:Y",$date);

« previous php.general (#16208) next »