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


Manual Reference Pages  -  DANCER2::CORE::TIME (3)

.ds Aq ’

NAME

Dancer2::Core::Time - class to handle common helpers for time manipulations

CONTENTS

VERSION

version 0.166001

SYNOPSIS



    my $time = Dancer2::Core::Time->new( expression => "1h" );
    $time->seconds; # return 3600



DESCRIPTION

For consistency, whenever something needs to work with time, it needs to be expressed in seconds, with a timestamp. Although it’s very convenient for the machine and calculations, it’s not very handy for a human-being, for instance in a configuration file.

This class provides everything needed to translate any human-understandable expression into a number of seconds.

ATTRIBUTES

    seconds

Number of seconds represented by the object. Defaults to 0.

    epoch

The current epoch to handle. Defaults to seconds + time.

    gmt_string

Convert the current value in epoch as a GMT string.

    expression

Required. A human readable expression representing the number of seconds to provide.

The format supported is a number followed by an expression. It currently understands:



    s second seconds sec secs
    m minute minutes min mins
    h hr hour hours
    d day days
    w week weeks
    M month months
    y year years



Months and years are currently fixed at 30 and 365 days. This may change. Anything else is used verbatim as the expression of a number of seconds.

Example:



    2 hours, 3 days, 3d, 1 week, 3600, etc...



AUTHOR

Dancer Core Developers

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

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


perl v5.20.3 DANCER2::CORE::TIME (3) 2016-01-22

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