Jesse Vincent > Jifty > Jifty::DateTime

Download:
Jifty-0.70824.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  13
Open  4
Stalled  1
View/Report Bugs
Source   Latest Release: Jifty-1.10518

NAME ^

Jifty::DateTime - a DateTime subclass that knows about Jifty users

DESCRIPTION ^

Jifty natively stores timestamps in the database in GMT. Dates are stored without timezone. This class loads and parses dates and sets them into the proper timezone.

new ARGS

See "new" in DateTime. After calling that method, set this object's timezone to the current user's time zone, if the current user has a method called time_zone.

current_user_has_timezone

Return timezone if the current user has it

new_from_string STRING

Take some user defined string like "tomorrow" and turn it into a Jifty::Datetime object. If the string appears to be a _date_, keep it in the floating timezone, otherwise, set it to the current user's timezone.

friendly_date

Returns the date given by this Jifty::DateTime object. It will display "today" for today, "tomorrow" for tomorrow, or "yesterday" for yesterday. Any other date will be displayed in ymd format.

syntax highlighting: