note 86766 added to function.date
| From: | Grapsus at osu1 dot php dot net | Date: | Sun, 02 Nov 2008 23:38:58 +0000 |
| Subject: | note 86766 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146068@lists.php.net to get a copy of this message | ||
Here's a small function which returns TRUE if European Summer Time is used (now or at a given
date) :
if(!function_exists('estdst'))
{
function estdst($ts=false)
{
$ts = $ts?$ts:time();
$year = gmdate('Y', $ts);
$end = gmmktime(1, 0, 0, 3, 31 - ((5 * $year) / 4 + 4)%7, $year);
$start = gmmktime(1, 0, 0, 10, 31 - ((5 * $year) / 4 + 1)%7, $year);
return $ts < $end || $ts > $start;
}
}
Calculation formula taken from here : http://en.wikipedia.org/wiki/European_Summer_Time
----
Server IP: 213.246.51.26
Probable Submitter: 82.245.89.120
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/86766
Del: integrated -- https://master.php.net/note/delete/86766/integrated
Del: useless -- https://master.php.net/note/delete/86766/useless
Del: bad code -- https://master.php.net/note/delete/86766/bad+code
Del: spam -- https://master.php.net/note/delete/86766/spam
Del: non-english -- https://master.php.net/note/delete/86766/non-english
Del: in docs -- https://master.php.net/note/delete/86766/in+docs
Del: other reasons-- https://master.php.net/note/delete/86766
Reject -- https://master.php.net/note/reject/86766
Search -- https://master.php.net/manage/user-notes.php