SYNOPSIS

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

DESCRIPTION

This module understands the formats used by \s-1DB2\s0 for its \s-1DATE\s0, \s-1TIME\s0, and \s-1TIMESTAMP\s0 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 \s-1DB2\s0 format.

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 \s-1DB2\s0 does not provide time zone information.

* parse_time($string)
* parse_date($string)
* parse_timestamp($string)

Given a value of the appropriate type, this method will return a new \*(C`DateTime\*(C' object. The time zone for this object will always be the floating time zone, because by \s-1DB2\s0 stores the local datetime, not \s-1UTC\s0. If given an improperly formatted string, this method may die.

* format_date($datetime)
* format_time($datetime)
* format_timestamp($datetime)

Given a \*(C`DateTime\*(C' object, this methods returns an appropriately formatted string.

SUPPORT

Support for this module is provided via the [email protected] email list. See http://lists.perl.org/ for more details.

AUTHOR

Jess Robinson <[email protected]>

This module was shamelessly cloned from Dave Rolsky's DateTime::Format::MySQL module.

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.

RELATED TO DateTime::Format::DB2…

[email protected] mailing list

http://datetime.perl.org/