GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DateTime::Format::MySQL(3) User Contributed Perl Documentation DateTime::Format::MySQL(3)

DateTime::Format::MySQL - Parse and format MySQL dates and times

  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);

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.

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 by 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 for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details.

Dave Rolsky <autarch@urth.org>

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.

datetime@perl.org mailing list

http://datetime.perl.org/

2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.