Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

miyagawa (1653)

miyagawa
  (email not shown publicly)
http://bulknews.vox.com/
AOL IM: bulknews (Add Buddy, Send Message)

Journal of miyagawa (1653)

Friday November 10, 2006
11:02 AM

what's the best DateTime format to preserve Olson timezones?

[ #31563 ]

What is the best available DateTime format that preserves Olson timezone names?

Here's the deal: To create an iCal feed for a various website, I use Plagger and its plugin architecture.

1) script/slims_calendar.pl fetches the Slim's calendar site and scrapes the HTML to get the schedule, prints the date and title to STDOUT as YAML or RSS.

2) Plagger CustomFeed::Script parses the output of the script with Date::Parse, then create a DateTime object.

3) Publish::iCal plugin emits iCal feed using Data::ICal and DateTime::Format::ICal.

The biggest concern here is how to pass Datetime from 1) to 2) while preserving Olson TZ names. Even if I say "hey, here's the schedule with date timezone America/Los_Angeles," if you format the datetime in W3CDTF in the script output, the Olson name is lost in the middle. i.e. When you parse theW3CDTF format, TZ is now OffsetOnly, without the Olson.

Note that it's not a blocker or whatever. Publish::iCal is carefully coded to use the UTC date if the datetime is not flagged with Olson name. And there's also Filter::ForceTimeZone to force set Olson TZ later if you'd like, so it just works with iCal, Google Calendar or Sunbird fine.

But I'm just curious what's the bestway to do round-trip Datetime object and string while preserving Olson timezone names.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.