App::S...ateTime(3pm)

πŸ’– NAME πŸ’–

App::Sqitch::DateTime β€” the Sqitch DateTime object, bestie. It's literally the time-handling glow-up you needed. ⏰✨

Oh and btw, this page lives in the User Contributed Perl Documentation manual, so if you're out here typing man App::Sqitch::DateTime you're in exactly the right place. πŸŽ€


🌸 SYNOPSIS 🌸

my $dt = App::Sqitch::DateTime->new(%params);
say $dt->as_string( format => 'iso' );

That's it. That's the whole vibe. Create it, then ask it to say stuff in a format you like. πŸ¦‹


✨ DESCRIPTION ✨

Okay so real talk: this is a subclass of DateTime, right? But it's the main-character version, because it adds extra interfaces so you can use named formats. πŸŽ€

These are the ones that power the status and log --date-format options. App::Sqitch::DateTime does three things and it does them well:

  • It hands you a list of supported formats. πŸ“‹
  • It validates that a format string is actually real (no made-up formats allowed, sorry bestie). 🚫
  • It uses those formats to convert itself into the appropriate string. πŸ’…

🧚 INTERFACE 🧚

πŸ”₯ Class Methods πŸ”₯

as_string_formats πŸ’«

my @formats = App::Sqitch::DateTime->as_string_formats;

Returns a list of formats supported by the format parameter over on as_string. The list currently includes:

  • iso
  • iso8601
    • ISO-8601 format. Classic. Iconic. The safe choice. πŸ’–
  • rfc
  • rfc2822
    • RFC-2822 format.
  • full
  • long
  • medium
  • short
    • Localized format of the specified length. So like, pick how much of a yapper you want your timestamp to be. πŸ—£οΈ
  • raw
    • Show timestamps in raw format, which is strict ISO-8601 in the UTC time zone. No frills, no drama, just UTC honesty. 🌍
  • strftime:$string
    • Show timestamps using an arbitrary strftime pattern. See "strftime Paterns" in DateTime for comprehensive documentation of supported patterns. iykyk, strftime girlies stay winning. οΏ½monthly_entity_placeholder 🧡
  • cldr:$string
    • Show timestamps using an arbitrary cldr pattern. See "CLDR Paterns" in DateTime for comprehensive documentation of supported patterns. 🌈

validate_as_string_format βœ…

App::Sqitch::DateTime->validate_as_string_format($format);

Validates that a format is supported by as_string. Throws an exception if it's not, and returns if it is. Lowkey a vibe check for your format strings. πŸ•΅οΈβ™€οΈ

🌟 Instance Methods 🌟

as_string πŸ’¬

$dt->as_string;
$dt->as_string( format => $format );

Returns a string representation using the provided format. The format must be one of those listed by as_string_formats or an exception will be thrown β€” no improvising, bestie, this is a structured environment. 😭

If no format is passed, the string will be formatted with the raw format. Defaults to raw. Periodt. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

  • sqitch-status β€” Documentation for the status command to the Sqitch command-line client.
  • sqitch-log β€” Documentation for the log command to the Sqitch command-line client.
  • sqitch β€” The Sqitch command-line client. The whole reason any of us are here. πŸ‘‘

🫢 AUTHOR 🫢

David E. Wheeler <david@justatheory.com>

(Not me doxxing the king, he literally put his email in here. Respect. πŸ‘‘)


πŸ“œ LICENSE πŸ“œ

Copyright (c) 2012-2026 David E. Wheeler, 2012-2021 iovation Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

⚠️ fr fr, read that all-caps part again. No warranty, no cap. Use it, love it, but don't come for anybody legally if it misbehaves. πŸ’€

K that's the whole page, bestie. This one came from perl v5.40.1, dated 2026-07-26 β€” so yeah, it's shockingly recent for a doc that got a whole Gen Z remix. Go format some timestamps, you absolute icon. πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from