MT::Telegraph::Util
NAME
MT::Telegraph::Util - Utility methods for the Telegraph framework
VERSION
Telegraph 0.62
SYNOPSIS
use MT::Telegraph::Util qw(timestamp as_utc);
my $now = timestamp();
my $yesterday = timstamp(time - 86400);
my $utc = as_utc('2005-04-22T15:23:12-05:00');
DESCRIPTION
MT::Telegraph::Util is a package of utility functions that are optionally exported into Telegraph modules as needed.
METHODS
- timestamp([$epoch])
A method that will generate an Movable Type timestamp (yyyymmddhhnnss) from a time represented as seconds from epoch. If a time is not explicitly provided, the current time is used. All times passed through this method are normalized to UTC using the perl function
gmtime. - as_utc($time)
A method that will convert a standard time string[1] such as RFC822 and W3CDTF/RFC8601 into a Movable Type timestamp. A times are normalized to UTC using the perl function
gmtime.[1] See the documention for
Data::Parsein CPAN for more details on which date formats it can interprept.
AUTHOR & COPYRIGHT
Copyright 2005-2007 Appnel Internet Solutions, LLC, info@appnel.com. All Rights Reserved. This code cannot be redistributed without permission of the author.
