Sep
04

Timezones, WordPress, Ical, Php….

WordPress  

What a lot of fun this can be (not!)

Your Ical file may have a timezone specified, the event may be in a another timezone.  Your host server in yet another timezone, (and your testing server in another), and your user or web viewer in yet another……  the event may be at a time that does not exist in another timezone (due to daylight saving for example!)

WordPress has a timezone setting ( not yet coping with daylight saving changes!!!) although there are plugins that purport to deal with this.

When you display an ical event listing in your web, my understanding is that we wish to echo the times from the Ical file, perhaps noting the timezone somewhere?

To get our school’s web working correctly, we had to

  1. check that google had the right timezone for us  – see settings for your calendar
  2. check that our host was reflecting the right timezone for us. This involved setting the timezone in .htaccess to SetEnv TZ :Australia/Sydney, as per https://www2.suresupport.com/faq/38/205
  3. check that wordpress had the right timezone (Not sure how much this is impacting the plugin script?   Should the plugin fetch the wordpress timezone, given that it may be wrong?  For now, setting the host server timezone did the trick.

PHP 5 has functionality now to cope with a lot of this, so methinks we need to do a bunch of worked examples to check what needs to be set where for optimal performance… soon.

If you cannot set your host server time, maybe this will helpL:

http://mu.wordpress.org/forums/topic.php?id=3123&page

Related posts:

  1. Timezones and offsets in wordpress Writing a plugin that requires a correct timezone object ?  Not sure how to deal with wordpress installations that may...
  2. Make wp-cron show times in your wordpress timezone wp-cron-dashboard by the prolific wokamoto (OKAMOTO Wataru) is a very simple but useful little plugin – saves having write your...
  3. WordPress.com or self-hosted wordpress Wordpress.org or Wordpress.com - some thoughts on choosing a wordpress webhost...
  4. Calculate date from day of year in php Here  is a simple first of several notes on useful date functions.  This function accepts  a year  (YYYY) and a...
  5. Debug a wordpress plugin or theme – for non-developers For non-developers - how to debug a plugin or theme, or at least provide some better information about why it...
Categories : WordPress

WP Questions

Preferred Web Host

Web hosting by ICDSoft Icdsoft - Why? They are good and reasonable, used them since 2001. Read more