Lines 138-149
$dt0 = dt_from_string( '2012-01-01T23:59:59.999+02:00', 'rfc3339' );
Link Here
|
138 |
cmp_ok( $dt0->epoch(), 'eq', '1325455199', 'dt_from_string handles seconds with 3 decimal places and a timezone' ); |
138 |
cmp_ok( $dt0->epoch(), 'eq', '1325455199', 'dt_from_string handles seconds with 3 decimal places and a timezone' ); |
139 |
|
139 |
|
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' ); # Do not combine Z with +02 ! |
142 |
}; |
142 |
}; |
143 |
like( $@, qr/.*does not match the date format \(rfc3339\).*/, 'dt_from_string should die when passed a bad rfc3339 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 |
|
144 |
|
145 |
eval { |
145 |
eval { |
146 |
$dt0 = dt_from_string('2021-11-03T10:16:59Z+00:00', 'iso'); |
146 |
$dt0 = dt_from_string('2021-11-03T10:16:59Z+00:00', 'iso'); # Z and +00 are the same, but should not be together |
147 |
}; |
147 |
}; |
148 |
like( $@, qr/.*does not match the date format \(iso\).*/, 'dt_from_string should die when passed a bad iso date string' ); |
148 |
like( $@, qr/.*does not match the date format \(iso\).*/, 'dt_from_string should die when passed a bad iso date string' ); |
149 |
|
149 |
|
150 |
- |
|
|