Knowledge Base / Appnel Solutions 

Last Modified
8 January 2007 @ 5pm

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::Parse in 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.


 

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated. Please do not use the feedback form to submit support requests or question. We will not respond to or publish such queries submitted through this form.

Back to Home