• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Next Daylight Saving Change Date
PostPosted: Sun Jun 10, 2012 6:56 am 
Forum Members
Forum Members
User avatar

Joined: Wed Aug 08, 2007 2:38 pm
Posts: 19
On one of my pages I have a reference to the next daylight saving change date. I used to update this page after every daylight saving time change but to simplify matters I created below UDT.

I think it's straight forward. The date format settings are for Austria/Europe and the daylight saving dates accordingly but can be adjusted to your need.

setlocale(LC_ALL, 'de_AT');
if (time()>strtotime("Last Sunday April 1")) {
  if (time()>strtotime("Last Sunday November 1")) {
    echo utf8_encode(strftime("%d. %B %Y",strtotime("Last Sunday April 1 ".date("Y",strtotime("Next Year")))));
  } else {
    echo utf8_encode(strftime("%d. %B %Y",strtotime("Last Sunday November 1"))); 
} else {
  echo utf8_encode(strftime("%d. %B %Y",strtotime("Last Sunday April 1")));

To see it in action: http://www.elektrotechnik-schmidt.at/fi-schutzschalter/

Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting