NAME

OP::DateTime

VERSION

$Id: //depotit/tools/source/snitchd-0.20/lib/OP/DateTime.pm#15 $

SYNOPSIS

use OP::DateTime;

my $time = OP::DateTime->new( time() );

DESCRIPTION

Time object.

Extends OP::Object, Time::Piece. Overloaded for numeric comparisons, stringifies as unix epoch seconds unless overridden.

PUBLIC CLASS METHODS

  • assert(OP::Class $class: *@rules)

    Returns a new OP::Type::DateTime instance which encapsulates the received OP::Subtype rules.

    create "OP::Example" => {
      someTimestamp  => OP::DateTime->assert(optional()),
    
      # ...
    };
  • new(OP::Class $class: Num $epoch)

    Returns a new OP::DateTime instance which encapsulates the received value.

    my $object = OP::DateTime->new($epoch);

SEE ALSO

See the Time::Piece module for time formatting and manipulation methods inherited by this class.

This file is part of OP.