Twitter::Date - Helper for Twiter date management
use Twitter::Date; use Error qw(:try); try { my $date = Twitter::Date->new('Thu Dec 09 19:50:41 +0000 2010'); if ( $date->gt($meetingDate) ) { sendMail( "Ooops, I'm arriving late" ); } } catch Twitter::NoDateError with { manageError( "no date, sorry" ); }
When needing to work with dates returned by Twitter in its timelines it's better to encapsulate the behaviour to manipulate them. This is what this package is for.
Creates a new Twitter::Date object
date (mandatory)
String date
Returns the seconds for the current date
Returns the minutes for the current date
Returns the hours for the current date
Returns the day for the current date
Returns the month for the current date
Returns the year for the current date
Returns the time zone for the current date
Compares the current date with the one in the argument (also a Twitter::Date object) Returns 1 if they are equal or 0 otherwise.
Twitter::Date object
Compares the current date with the one in the argument (also a Twitter::Date object) Returns 1 if the current one is less than the argument and 0 otherwise.
Compares the current date with the one in the argument (also a Twitter::Date object) Returns 1 if the current one is greater than the argument and 0 otherwise.
Compares the current date with the on in the argument (also a Twitter::Date object) Returns -1, 0, or 1 depending on whether the passed date is grater than, equal to, or less than the date in the argument. Very useful to be used in sort()
Victor A. Rodriguez (Bit-Man)
Error (exception catching and management)
To install Twitter::Daily, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Twitter::Daily
CPAN shell
perl -MCPAN -e shell install Twitter::Daily
For more information on module installation, please visit the detailed CPAN module installation guide.