Jifty:...teTime(3pm)
β¨ NAME β¨
Jifty::DBI::Filter::DateTime β it's giving DateTime object wrapper around date columns, bestie π
π¦ DESCRIPTION π¦
okay so listen. this filter lets you vibe with DateTime objects instead of boring plain-text dates. no cap. π
if the column type is date, then the hour, minute, and second info gets discarded when encoding. bye bye time-of-day details, we don't know her π
and both input AND output will always be coerced into UTC (or, in the case of Dates, the Floating timezone) for consistency. fr fr, consistency is the moment.
πΈ formatter
this is an instance of the DateTime::Format object used for inflating the string in the database into a DateTime object. by default it's a DateTime::Format::Strptime object that uses the _strptime method as its pattern. iconic behavior honestly β¨
you can use the _formatter classdata storage as a cache so you don't need to re-instantiate your format object every decode. efficiency? we love to see it π«Ά
π encode
if value is a DateTime object then it converts it into ISO format YYYY-MM-DD hh:mm:ss. does nothing if value is not defined. periodt.
sets the value to undef if the value is a string and doesn't match an ISO date (at least). like, at minimum. minimum effort bestie π
π decode
if value is defined then it converts it into a DateTime object, otherwise it does nothing. that's it that's the whole vibe π
π SEE ALSO π
- Jifty::DBI::Filter
- DateTime
and that's the tea, bestie π this page rode in on perl v5.34.0, dated 2022-06-15, and it's part of the User Contributed Perl Documentation β go off, perl, we stan πβ¨
π¦ where this page comes from
- debian bookworm: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms