NAME

Sisimai::DateTime - Date and time utilities

SYNOPSIS

use Sisimai::DateTime;
my $v = 'Sat Mar  1 13:47:46 JST 2014';
print Sisimai::DateTime->parse($v);  # Sat, 1 Mar 2014 13:47:46 +0900

DESCRIPTION

Sisimai::DateTime provide methods for dealing date and time.

CLASS METHODS

parse(Date string)

parse() method converts a various date format string.

my $x = 'Fri, 9 Apr 2004 04:01:03 +0000 (GMT)';
my $y = '27 Apr 2009 08:08:54 +0900';
print Sisimai::DateTime->parse($x);  # Fri, 9 Apr 2004 04:01:03 +0000
print Sisimai::DateTime->parse($y);  # Thu, 27 Apr 2009 08:08:54 +0900

abbr2tz(Abbr)

abbr2tz() method converts a time zone abbreviation to 4 digit string of time zone.

print Sisimai::DateTime->abbr2tz('JST');   # +0900
print Sisimai::DateTime->abbr2tz('UTC');   # +0000
print Sisimai::DateTime->abbr2tz('CDT');   # -0500

AUTHOR

azumakuniyuki

COPYRIGHT

Copyright (C) 2014-2024 azumakuniyuki, All rights reserved.

LICENSE

This software is distributed under The BSD 2-Clause License.