note 30821 added to function.strtotime
| From: | stuartc1 at hotmail dot com | Date: | Mon, 31 Mar 2003 15:40:14 +0000 |
| Subject: | note 30821 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46013@lists.php.net to get a copy of this message | ||
As a solution to the above message:
<?
if(date("I") == 1){
// Daylight Saving is ON
function last_sunday() {
return gmdate("Y-m-d", mktime("Last Sunday"));
}
} else {
// Daylight Saving is OFF
function last_sunday() {
return date("Y-m-d", strtotime("Last Sunday"));
}
}
echo "Last Sunday is returned as: ".last_sunday();
?>
I hope this helps someone :)
--
http://www.php.net/manual/en/function.strtotime.php
http://master.php.net/manage/user-notes.php?action=edit+30821
http://master.php.net/manage/user-notes.php?action=delete+30821
http://master.php.net/manage/user-notes.php?action=reject+30821