Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
t
 
 
 
 
 
 
 
 
 
 
 
 

README.md

DateTime::TimeZone

Introduction

TimeZone handling for Perl 6.

Subroutines

tz-offset(Str $offset-string) --> Int

Parses common offset strings and returns an Int value.

timezone(Str $name, DateTime $datetime?) --> DateTime::TimeZone

Returns a TimeZone object representing the zone passed to it. These objects provide an .Int call, so they may be used directly as the :timezone parameter for a DateTime object.

This will support any timezone listed in the Olson database.

The $datetime is used to calculate the offset depending on Daylight Savings Time rules for the given Time Zone.

If $datetime is not passed, it assumes DateTime.now();

to-timezone(Str $name, DateTime $datetime)

A shortcut for: $datetime.in-timezone(timezone($name, $datetime));

TODO

This is very much under development, and currently only the tz-offset() subroutine is supported.

Authors

License

Artistic License 2.0

About

DateTime::TimeZone (Perl 6)

Resources

Releases

No releases published
You can’t perform that action at this time.