NAME

Tibco::Rv::Msg::DateTime - Tibco DateTime datatype

SYNOPSIS

my ( $date ) = $msg->createDateTime;
my ( $now ) = Tibco::Rv::Msg::DateTime->now;
$msg->addDateTime( now => $now );
print "time: $now\n";

DESCRIPTION

DateTime-manipulating class. Holds seconds since the epoch plus some nanoseconds.

CONSTRUCTOR

$date = new Tibco::Rv::Msg::DateTime( %args )
%args:
   sec => $seconds,
   nsec => $nanoseconds

Creates a Tibco::Rv::Msg::DateTime, with $seconds since the epoch (defaults to 0 if unspecified), and $nanoseconds before or after that time (defaults to 0 if unspecified).

$now = Tibco::Rv::Msg::DateTime->now

Creates a Tibco::Rv::Msg::DateTime with seconds specifying the current time.

METHODS

$sec = $date->sec

Returns the seconds.

$date->sec( $sec )

Sets the seconds.

$nsec = $date->nsec

Returns the nanoseconds.

$date->nsec( $nsec )

Sets the nanoseconds.

$str = $date->toString (or "$date")

Returns a string representation of $date. For example, "Fri Jan 31 04:43:55 2003Z". Note that this is Zulu (GMT) time. Or, simply use $date in a string context.

$date->toNum (or 0+$date)

Returns the number of seconds since the epoch represented by $date. Suitable for passing to localtime( ) or other time functions. Or, simply use $date in a numeric context.

AUTHOR

Paul Sturm <sturm@branewave.com>