note 86766 modified in function.date by felipe

From: Date: Mon, 03 Nov 2008 21:22:07 +0000
Subject: note 86766 modified in function.date by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-146096@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) : <?php 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 --was-- 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 http://php.net/manual/en/function.date.php

« previous php.notes (#146096) next »