NAME

BusyBird::DateTime::Format - DateTime::Format for BusyBird

SYNOPSIS

use BusyBird::DateTime::Format;
my $f = 'BusyBird::DateTime::Format';

## Twitter API format
my $dt1 = $f->parse_datetime('Fri Feb 08 11:02:15 +0900 2013');

## Twitter Search API format
my $dt2 = $f->parse_datetime('Sat, 16 Feb 2013 23:02:54 +0000');

my $str = $f->format_datetime($dt2);
## $str: 'Sat Feb 16 23:02:54 +0000 2013'

DESCRIPTION

This class is the standard DateTime::Format in BusyBird.

It has a separate distribution from BusyBird, so that input/filter modules do not have to depend on the entire BusyBird infrastructure.

BusyBird::DateTime::Format can parse the following format.

  • 'created_at' format of Twitter API.

  • 'created_at' format of Twitter Search API v1.0.

It formats DateTime object in 'created_at' format of Twitter API.

CLASS METHODS

$f = BusyBird::DateTime::Format->new()

Creates a formatter.

CLASS AND OBJECT METHODS

The following methods can apply both to class and to an object.

$datetime = $f->parse_datetime($string)

Parse $string to get DateTime object.

If given an improperly formatted string, this method returns undef. It NEVER croaks.

$string = $f->format_datetime($datetime)

Format DateTime object to a string.

SEE ALSO

BusyBird

REPOSITORY

https://github.com/debug-ito/BusyBird-DateTime-Format

BUGS AND FEATURE REQUESTS

Please report bugs and feature requests to my Github issues https://github.com/debug-ito/BusyBird-DateTime-Format/issues.

Although I prefer Github, non-Github users can use CPAN RT https://rt.cpan.org/Public/Dist/Display.html?Name=BusyBird-DateTime-Format. Please send email to bug-BusyBird-DateTime-Format at rt.cpan.org to report bugs if you do not have CPAN RT account.

AUTHOR

Toshio Ito, <toshioito at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2014 Toshio Ito.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.