Michael,

I just uploaded a new version of libtime-piece-mysql-perl with the
following change, which I believe fixes the bug:

--- libtime-piece-mysql-perl-0.05.orig/lib/Time/Piece/MySQL.pm
+++ libtime-piece-mysql-perl-0.05/lib/Time/Piece/MySQL.pm
@@ -66,8 +66,9 @@
 }
 
 sub from_mysql_timestamp {
-    # From MySQL version 4.1, timestamps are returned as datetime strings
     my ($class, $timestamp) = @_;
+    # from MySQL 4.1 onward, timestamps are punctuated like datetimes
+    $timestamp =~ s/[-: ]//g;
     my $length = length $timestamp;
     # most timestamps have 2-digit years, except 8 and 14 char ones
     if ( $length != 14 && $length != 8 ) {
--- libtime-piece-mysql-perl-0.05.orig/t/timestamp.t
+++ libtime-piece-mysql-perl-0.05/t/timestamp.t
@@ -11,6 +11,7 @@
     '1202110545' => '20120211054500',
     '120211054537' => '20120211054537',
     '20120211054537' => '20120211054537',
+    '2012-02-11 05:45:37' => '20120211054537',
 );
 
 #my @null = qw/ 19691231235959 20380101000000 /;
-- END --

Ben.

-- 
Ben Hutchings -- [EMAIL PROTECTED] shortened to [EMAIL PROTECTED]
If you've signed my GPG key, please send a signature on and to the new uid.
Hoare's Law of Large Problems:
        Inside every large problem is a small problem struggling to get out.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to