DateTi...::MySQL(3pm)
π DateTime::Format::MySQL π
okay bestie, welcome to the DateTi...::MySQL(3pm) page from the User Contributed Perl Documentation. This one is all about DateTime::Format::MySQL, and it's giving βmake MySQL date strings and DateTime objects talk to each otherβ energy. π¦β¨
β¨ NAME β¨
DateTime::Format::MySQL β Parse and format MySQL dates and times. π
πΈ SYNOPSIS πΈ
use DateTime::Format::MySQL;
my $dt = DateTime::Format::MySQL->parse_datetime( '2003-01-16 23:12:01' );
# 2003-01-16 23:12:01
DateTime::Format::MySQL->format_datetime($dt);
π DESCRIPTION π
This module understands the formats used by MySQL for its DATE, DATETIME, TIME, and TIMESTAMP data types. It can be used to parse these formats in order to create DateTime objects, and it can take a DateTime object and produce a string representing it in the MySQL format. No cap, it's a little bilingual translator for dates. πβ¨
π METHODS π
This class offers the following methods. All of the parsing methods set the returned DateTime object's time zone to the floating time zone, because MySQL does not provide time zone information. π
parse_datetime($string)parse_date($string)parse_timestamp($string)
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 MySQL stores the local datetime, not UTC.
If given an improperly formatted string, this method may die. π
format_date($datetime)format_time($datetime)format_datetime($datetime)
Given a DateTime object, this methods returns an appropriately formatted string. π«Ά
π SUPPORT π
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. Slide into that list if you need backup. π
π AUTHOR π
Dave Rolsky <autarch@urth.org> β iconic. π
π COPYRIGHT π
Copyright (c) 2003-2014 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
π SEE ALSO π
datetime@perl.orgmailing listhttp://datetime.perl.org/
cute sign-off: this page is from perl v5.42.0, dated 2023-08-02, and it lives under the manual name DateTi...::MySQL(3pm). mwah ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-DateTime-Format-MySQL 0.0800-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms