Lines 4-10
use DateTime::TimeZone;
Link Here
|
4 |
|
4 |
|
5 |
use C4::Context; |
5 |
use C4::Context; |
6 |
|
6 |
|
7 |
use Test::More tests => 79; |
7 |
use Test::More tests => 80; |
8 |
|
8 |
|
9 |
use Test::MockModule; |
9 |
use Test::MockModule; |
10 |
use Test::Warn; |
10 |
use Test::Warn; |
Lines 140-146
cmp_ok( $dt0->epoch(), 'eq', '1325455199', 'dt_from_string handles seconds with
Link Here
|
140 |
eval { |
140 |
eval { |
141 |
$dt0 = dt_from_string( '2012-01-01T23:59:59.999Z+02:00', 'rfc3339' ); |
141 |
$dt0 = dt_from_string( '2012-01-01T23:59:59.999Z+02:00', 'rfc3339' ); |
142 |
}; |
142 |
}; |
143 |
like( $@, qr/.*does not match the date format \(rfc3339\).*/, 'dt_from_string should die when passed a bad date string' ); |
143 |
like( $@, qr/.*does not match the date format \(rfc3339\).*/, 'dt_from_string should die when passed a bad rfc3339 date string' ); |
|
|
144 |
|
145 |
eval { |
146 |
$dt0 = dt_from_string('2021-11-03T10:16:59+00:00', 'iso'); |
147 |
}; |
148 |
like( $@, qr/.*does not match the date format \(iso\).*/, 'dt_from_string should die when passed a bad iso date string' ); |
144 |
|
149 |
|
145 |
# Return undef if passed mysql 0 dates |
150 |
# Return undef if passed mysql 0 dates |
146 |
$dt0 = dt_from_string( '0000-00-00', 'iso' ); |
151 |
$dt0 = dt_from_string( '0000-00-00', 'iso' ); |
147 |
- |
|
|