![]() |
![]()
| ![]() |
![]()
NAMEMango::BSON::Time - Datetime typeSYNOPSISuse Mango::BSON::Time; my $time = Mango::BSON::Time->new(time * 1000); say $time->to_epoch; DESCRIPTIONMango::BSON::Time is a container for the BSON datetime type used by Mango::BSON.METHODSMango::BSON::Time inherits all methods from Mojo::Base and implements the following new ones.newmy $time = Mango::BSON::Time->new; my $time = Mango::BSON::Time->new(time * 1000); Construct a new Mango::BSON::Time object. TO_JSONmy $num = $time->TO_JSON; Numeric representation of time. to_datetimemy $str = $time->to_datetime; Convert time to RFC 3339 <http://tools.ietf.org/html/rfc3339> date and time. to_epochmy $epoch = $time->to_epoch; Convert time to floating seconds since the epoch. to_stringmy $str = $time->to_string; Stringify time. OPERATORSMango::BSON::Time overloads the following operators.boolmy $bool = !!$time; Always true. stringifymy $str = "$time"; Alias for "to_string". SEE ALSOMango, Mojolicious::Guides, <http://mojolicio.us>.
|