![]() To get output relative to an arbitrary offset, do: $ical_string = $ical->ical( offset => '+0545' ) epoch $epoch_time = $ical->epoch To get output in localtime relative to the current machine, do: $ical_string = $ical->ical( localtime => 1 ) Output is in UTC (ends with a "Z") by default. Retrieves, or sets, the date on the object, using any valid ICal date/time string. If you enter a time that's not *explicitly* in UTC, it looks at the environment variable $TZ, if it exists, to determine your local offset. Note that as of version 1.44, new() tries to be intelligent about figuring out your local time zone. If you want to set up a time that's in the US "Pacific" timezone, which is GMT-8, use something like: my $ical = Date::ICal->new( ical => '19971024T120000', It defaults times to UTC (Greenwich Mean Time, also called Zulu). My $disco = Date::Discordian->new( disco => '12 Chaos, YOLD 3177' ) ![]() This is particularly useful for converting from one calendar to another: # Direct conversion from Discordian to ISO dates If you already have an object in Date::ICal, or some other subclass thereof, you can create a new Date::ICal (or subclass) object using that object to start with. If you call new without any arguments, you'll get a Date::ICal object that is set to the time right now. Or, better still, create it with components my $date = Date::ICal->new( ![]() ![]() Or with any epoch time: my $ical = Date::ICal->new( epoch => time ) # will default to the timezone specified in $TZ, see below Last touched by $Author: rbowen $ METHODSĭate::ICal has the following methods available: newĪ new Date::ICal object can be created with any valid ICal string: my $ical = Date::ICal->new( ical => '19971024T120000' ) See for more modern and accurate modules. $ical += 'P6DT12H' ĭate::ICal talks the ICal date format, and is intended to be a base class for other date/calendar modules that know about ICal time format also. (Where $duration is either a duration string, like 'P2W3DT7H9M', or a Date::ICal::Duration (qv) object. $ical = Date::ICal->new( epoch => time ) $Revision: 679 $ SYNOPSIS use Date::ICal And this feature makes it easy.Īre there other features of the Calendar app that you find extremely helpful? Let us know what they are in the comments below.Date::ICal - Perl extension for ICalendar date objects. In these days of remote work and business travel, being aware of and being able to plan for different time zones is essential. If you leave this setting disabled, dates and times for your events will display in the time zone of your current location.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |