Víctor A. Rodríguez > Twitter-Daily-0.1.3 > Twitter::Date

Download:
Twitter-Daily-0.1.3.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Twitter::Date - Helper for Twiter date management

SYNOPSIS ^

 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" );
 }

DESCRIPTION ^

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.

INTERFACE ^

new

Creates a new Twitter::Date object

options

getSeconds

Returns the seconds for the current date

getMinutes

Returns the minutes for the current date

getHour

Returns the hours for the current date

getDay

Returns the day for the current date

getMonth

Returns the month for the current date

getYear

Returns the year for the current date

getTimeZone

Returns the time zone for the current date

eq

Compares the current date with the one in the argument (also a Twitter::Date object) Returns 1 if they are equal or 0 otherwise.

options

lt

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.

options

gt

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.

options

cmp

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()

options

AUTHOR ^

Victor A. Rodriguez (Bit-Man)

SEE ALSO ^

Error (exception catching and management)

syntax highlighting: