Time::Piece 1.33 supports passing objects to gmtime which is necessary
on 32-bit platforms where arguments might be bigints.
+ * Fix parsing KDBX4 datetimes on 32-bit perls.
+
0.902 2022-05-03 19:18:06-0600
* Added support for 32-bit perls.
0.902 2022-05-03 19:18:06-0600
* Added support for 32-bit perls.
use List::Util qw(any first);
use Ref::Util qw(is_ref is_arrayref is_plain_hashref);
use Scalar::Util qw(blessed);
use List::Util qw(any first);
use Ref::Util qw(is_ref is_arrayref is_plain_hashref);
use Scalar::Util qw(blessed);
use boolean;
use namespace::clean;
use boolean;
use namespace::clean;
use File::KDBX::Util qw(:class :int erase_scoped gzip snakify);
use IO::Handle;
use Scalar::Util qw(blessed isdual looks_like_number);
use File::KDBX::Util qw(:class :int erase_scoped gzip snakify);
use IO::Handle;
use Scalar::Util qw(blessed isdual looks_like_number);
use XML::LibXML;
use boolean;
use namespace::clean;
use XML::LibXML;
use boolean;
use namespace::clean;
use Ref::Util qw(is_coderef is_hashref is_plain_hashref);
use Scalar::Util qw(blessed looks_like_number);
use Storable qw(dclone);
use Ref::Util qw(is_coderef is_hashref is_plain_hashref);
use Scalar::Util qw(blessed looks_like_number);
use Storable qw(dclone);
use boolean;
use namespace::clean;
use boolean;
use namespace::clean;
use List::Util qw(any sum0);
use Ref::Util qw(is_coderef is_ref);
use Scalar::Util qw(blessed);
use List::Util qw(any sum0);
use Ref::Util qw(is_coderef is_ref);
use Scalar::Util qw(blessed);
use boolean;
use namespace::clean;
use boolean;
use namespace::clean;
use File::KDBX;
use Ref::Util qw(is_arrayref is_hashref);
use Scalar::Util qw(looks_like_number);
use File::KDBX;
use Ref::Util qw(is_arrayref is_hashref);
use Scalar::Util qw(looks_like_number);
use boolean;
use namespace::clean;
use boolean;
use namespace::clean;
our $VERSION = '999.999'; # VERSION
our $VERSION = '999.999'; # VERSION
-my $DEFAULT_EXPIRATION = Time::Piece->new(32503677839); # 2999-12-31 23:59:59
+my $DEFAULT_EXPIRATION = Time::Piece->strptime('2999-12-31 23:59:59', '%Y-%m-%d %H:%M:%S');
use File::KDBX::Safe;
use File::KDBX::Util qw(:class :int :text gunzip erase_scoped);
use Scalar::Util qw(looks_like_number);
use File::KDBX::Safe;
use File::KDBX::Util qw(:class :int :text gunzip erase_scoped);
use Scalar::Util qw(looks_like_number);
use XML::LibXML::Reader;
use boolean;
use namespace::clean;
use XML::LibXML::Reader;
use boolean;
use namespace::clean;
my $decoded = eval { _decode_primitive($content, $type) };
if (my $err = $@) {
ref $err and $err->details(node => $reader->nodePath, line => $reader->lineNumber);
my $decoded = eval { _decode_primitive($content, $type) };
if (my $err = $@) {
ref $err and $err->details(node => $reader->nodePath, line => $reader->lineNumber);
$binary .= \0 x (8 - length($binary)) if length($binary) < 8;
my ($seconds_since_ad1) = unpack_Ql($binary);
my $epoch = $seconds_since_ad1 - TIME_SECONDS_AD1_TO_UNIX_EPOCH;
$binary .= \0 x (8 - length($binary)) if length($binary) < 8;
my ($seconds_since_ad1) = unpack_Ql($binary);
my $epoch = $seconds_since_ad1 - TIME_SECONDS_AD1_TO_UNIX_EPOCH;
- return Time::Piece->new($epoch);
my $dt = eval { Time::Piece->strptime($_, '%Y-%m-%dT%H:%M:%SZ') };
if (my $err = $@) {
throw 'Failed to parse datetime', text => $_, error => $err;
my $dt = eval { Time::Piece->strptime($_, '%Y-%m-%dT%H:%M:%SZ') };
if (my $err = $@) {
throw 'Failed to parse datetime', text => $_, error => $err;
use Module::Load;
use Ref::Util qw(is_arrayref is_coderef is_hashref is_ref is_refref is_scalarref);
use Scalar::Util qw(blessed looks_like_number readonly);
use Module::Load;
use Ref::Util qw(is_arrayref is_coderef is_hashref is_ref is_refref is_scalarref);
use Scalar::Util qw(blessed looks_like_number readonly);
use boolean;
use namespace::clean -except => 'import';
use boolean;
use namespace::clean -except => 'import';
is $kdbx->minimum_version, KDBX_VERSION_4_1, 'Icon with name requires upgrade';
$kdbx->remove_custom_icon($icon_uuid);
is $kdbx->minimum_version, KDBX_VERSION_3_1, 'Reset upgrade requirement';
is $kdbx->minimum_version, KDBX_VERSION_4_1, 'Icon with name requires upgrade';
$kdbx->remove_custom_icon($icon_uuid);
is $kdbx->minimum_version, KDBX_VERSION_3_1, 'Reset upgrade requirement';
- $icon_uuid = $kdbx->add_custom_icon('data2', last_modification_time => gmtime);
+ $icon_uuid = $kdbx->add_custom_icon('data2', last_modification_time => scalar gmtime);
is $kdbx->minimum_version, KDBX_VERSION_4_1, 'Icon with modtime requires upgrade';
$kdbx->remove_custom_icon($icon_uuid);
is $kdbx->minimum_version, KDBX_VERSION_3_1, 'Reset upgrade requirement';
is $kdbx->minimum_version, KDBX_VERSION_4_1, 'Icon with modtime requires upgrade';
$kdbx->remove_custom_icon($icon_uuid);
is $kdbx->minimum_version, KDBX_VERSION_3_1, 'Reset upgrade requirement';