GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Sisimai::DateTime(3) User Contributed Perl Documentation Sisimai::DateTime(3)

Sisimai::DateTime - Date and time utilities

    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

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

"parse()" convert 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

"to_string()" convert a string to the value of seconds like followings:

    print Sisimai::DateTime->to_second('1m');  # 60, 1 minute
    print Sisimai::DateTime->to_second('2h');  # 7200, 2 hours
    print Sisimai::DateTime->to_second('1d');  # 86400, 1 day
    print Sisimai::DateTime->to_second('1w');  # 604800, 1 week

"abbr2tz()" convert 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

azumakuniyuki

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

This software is distributed under The BSD 2-Clause License.
2021-02-22 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.