note 70476 deleted from function.mktime by bobby
| From: | bobby@php.net | Date: | Wed, 18 Oct 2006 14:51:10 +0000 |
| Subject: | note 70476 deleted from function.mktime by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118689@lists.php.net to get a copy of this message | ||
Note Submitter: splogamurugan at gmail dot com
----
This function will check the current time is in DST or not for europe countries.
function chkIsDSTForEurope()
{
$year=date('Y');
$start_date = date('Y-m-d', strtotime('-1 week sunday', strtotime("April
1, $year"))+ 43200).' 12:59:59';
$end_date = date('Y-m-d', strtotime('-1 week sunday', strtotime("November
1, $year"))+ 43200).' 12:59:59';
$sql=' SELECT now() > \''.$start_date.'\' AND
now()<\''.$end_date.'\' dst ';
$resource = mysql_query($sql);
$row=mysql_fetch_array($resource);
return $row['dst'];
}
Here,
$start_date = last sunday date for march.
$end_date = last sunday date for month October