]> Dogcows Code - chaz/p5-File-KDBX/commitdiff
improve dumping Time::Piece objects
authorCharles McGarvey <ccm@cpan.org>
Sun, 24 Apr 2022 20:07:06 +0000 (14:07 -0600)
committerCharles McGarvey <ccm@cpan.org>
Sun, 1 May 2022 00:29:00 +0000 (18:29 -0600)
lib/File/KDBX/Util.pm

index 9fe9a9eb318faf99efe195d2928b875b79ef4185..3141c3fe969c35369482d84bd85c911a87b81647 100644 (file)
@@ -223,7 +223,8 @@ sub dumper {
         # boolean
         $str =~ s/bless\( do\{\\\(my \$o = ([01])\)\}, 'boolean' \)/boolean($1)/gs;
         # Time::Piece
-        $str =~ s/bless\([^\)]+?(\d+)'?,\s+\d+,?\s+\], 'Time::Piece' \)/Time::Piece->new($1)/gs;
+        $str =~ s/bless\([^\)]+?(\d+)'?,\s+\d+,?\s+\], 'Time::Piece' \),/
+            "scalar gmtime($1), # " . scalar gmtime($1)->datetime/ges;
 
         print STDERR $str if !defined wantarray;
         push @dumps, $str;
This page took 0.024438 seconds and 4 git commands to generate.