Re: About date & time...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message ----- From: "Marcus Gnaß" <gonatan@xxxxxx>
To: "Gustav Wiberg" <gustav@xxxxxxxxxxxxxx>
Sent: Wednesday, March 01, 2006 5:24 PM
Subject: Re:  About date & time...


Gustav Wiberg schrieb:
function currenttime() {

 $t = date('h\:\ i\:\ s');
 $returnTime = str_replace(" ", "", $t);
 return $returnTime;

}

function currentdate() {

 $d = date('Y\-\ m\-\ d');
 $returnDate = str_replace(" ", "", $d);
 return $returnDate;

}
Although beeing a totally noob to PHP I suggest this instead:
function currenttime() {return date('H\:i\:s');}
function currentdate() {return date('Y\-m\-d');}

Marcus

Why?

return date('H\:i\:s') doesn't work as expected... :-)

/G

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux