DateTi...at::DB2(3pm)

πŸ“¦
version 0.06 Β· 5 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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 DateTime objects out of them 🫢
  • and it can take a DateTime object 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 a DateTime. πŸ•
  • parse_date($string) β€” parses a date value, gives you back a DateTime. πŸ“…
  • parse_timestamp($string) β€” parses a timestamp value, gives you back a DateTime. ⏱️

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 (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 🌈


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