note 58891 deleted from function.date by derick
| From: | derick@php.net | Date: | Sun, 15 Jan 2006 12:36:58 +0000 |
| Subject: | note 58891 deleted from function.date by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101813@lists.php.net to get a copy of this message | ||
Note Submitter: php at radio-network dot de
----
Here you have final functions for date and timestamp formatting!
Date formatting is german - you may change it !
function stamp2date($stamp){ // expects a valid timestamp
return date("d.m.Y", $stamp); // returns 19.11.2005
}
function date2stamp($date){ // format: 19.11.2005
$tmp = explode(".", $date);
return mktime(0,0,0,$tmp[1], $tmp[0], $tmp[2]);
}
Tweak it for yourself! But these vice-versa functions will help you a lot with handling dates on
databases <> forms