Jifty:...::Date(3pm)

πŸ“¦
version 0.78 Β· 2 versions
  • 0.78 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.78 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Jifty::DBI::Filter::Date πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation β€” it's Jifty::DBI::Filter::Date(3pm) and it's literally the moment your database stops being messy about dates. periodt.


✨ NAME ✨

Jifty::DBI::Filter::Date</purl> β€” a DateTime object wrapper around date columns. it's giving glow-up for your date fields, fr fr. πŸŽ€


🌸 DESCRIPTION 🌸

This filter lets you work with DateTime objects that represent "Dates", stores literally everything in the database in GMT, and does not hurt you badly when you pull them out and put them back in repeatedly. no cap, that's the whole vibe. πŸ’…


πŸ¦‹ encode πŸ¦‹

If the value is a DateTime object, it moves it into a "floating" timezone and expands it into ISO 8601 format:

YYYY-MM-DD

By storing it in the database as a floating timezone, it genuinely does not matter if the user's desired timezone changes between lookups. iconic behaviour honestly. πŸ‘‘

Does nothing if the value is not defined, or if it's a string. she simply minds her business. πŸ™ˆ

🧚 decode 🧚

If we're loading something from a column that doesn't specify times, then it gets loaded into a floating timezone. lowkey the cleanest way to do it.

If the value is defined, she converts it into a DateTime object. Otherwise? do nothing. that's it, that's the rule. ✨


⭐ SEE ALSO ⭐

  • Jifty::DBI::Filter
  • DateTime

iykyk, go read those next bestie 🫢


okay that's the whole page!! this came from perl v5.34.0, dated 2022-06-15, and the manual it lives in is Jifty:...::Date(3pm) β€” mwah, slay, go format some dates responsibly πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from