note 30821 deleted from function.strtotime by sniper
| From: | sniper@php.net | Date: | Tue, 21 Oct 2003 11:02:21 +0000 |
| Subject: | note 30821 deleted from function.strtotime by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59004@lists.php.net to get a copy of this message | ||
Note Submitter: stuartc1@hotmail.com
----
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 :)