DateTi...at::DB2(3pm)
π DateTime::Format::DB2 β the manual, but make it cute π
okay so bestie, you found it: this is the page for DateTime::Format::DB2, straight out of the User Contributed Perl Documentation (section 3pm, iykyk). It's the lil module that speaks DB2 date-and-time so you don't have to. π¦
β¨ NAME β¨
DateTime::Format::DB2 β parse and format DB2 dates and times. That's the whole vibe. Periodt. π
πΈ SYNOPSIS πΈ
Like, just look at her:
use DateTime::Format::DB2;
my $dt = DateTime::Format::DB2->parse_timestamp( '2003-01-16-23.12.01.300000' );
# 2003-01-16-23.12.01.300000
DateTime::Format::DB2->format_timestamp($dt);
No cap, that's genuinely all it takes. Parse in, format out, slay. β¨
π DESCRIPTION π
So this module understands the formats DB2 uses for its DATE, TIME, and TIMESTAMP data types. It's giving translator, honestly.
What it does:
- it can parse those formats so you get real
DateTimeobjects out of them π«Ά - and it can take a
DateTimeobject and produce a string representing it in the DB2 format π
Two-way street. Main character energy. π
π METHODS π
This class offers the following methods. And here's the tea, bestie β all of the parsing methods set the returned DateTime object's time zone to the floating time zone, because DB2 literally does not provide time zone information. Not our fault, we just live here. π
parse_time($string)β parses a time value, gives you back aDateTime. πparse_date($string)β parses a date value, gives you back aDateTime. πparse_timestamp($string)β parses a timestamp value, gives you back aDateTime. β±οΈ
Given a value of the appropriate type, this method will return a new DateTime object. The time zone for this object will always be the floating time zone, because DB2 stores the local datetime, not UTC. So don't come for us about UTC, it was never invited. π
If given an improperly formatted string, this method may die. Fr fr. Feed it garbage, and it might just end you. π
format_date($datetime)β hands you back a nicely formatted date string. πΈformat_time($datetime)β hands you back a nicely formatted time string. πformat_timestamp($datetime)β hands you back a nicely formatted timestamp string. β
Given a DateTime object, these methods return an appropriately formatted string. Simple as that, bestie. π
π«Ά SUPPORT π«Ά
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. Go on, they don't bite. π
π AUTHOR π
Jess Robinson <castaway@desert-island.demon.co.uk> π
This module was shamelessly cloned from Dave Rolsky's DateTime::Format::MySQL module. And honestly? Respect the hustle. π
π COPYRIGHT π
Copyright (c) 2005 Jess Robinson. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π§
π SEE ALSO π
datetime@perl.orgmailing listhttp://datetime.perl.org/
okay that's the whole page, bestie, you're officially DB2-literate π β¨ go format something iconic
Signing off with love: this was perl v5.40.1, dated 2025-03-08, and yes it's still DateTime::Format::DB2(3pm) the whole way through. bye babes π¦π
π¦ where this page comes from
- debian trixie: libdatetime-format-db2-perl 0.06-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdatetime-format-db2-perl 0.06-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdatetime-format-db2-perl 0.06-1 Β· 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