|
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 => 71; |
7 |
use Test::More tests => 72; |
| 8 |
|
8 |
|
| 9 |
use Test::MockModule; |
9 |
use Test::MockModule; |
| 10 |
use Test::Warn; |
10 |
use Test::Warn; |
|
Lines 131-138
cmp_ok( $dt0->epoch(), 'eq', '1325462340', 'dt_from_string handles seconds with
Link Here
|
| 131 |
$dt0 = dt_from_string( '2012-01-01T23:59:00.00Z', 'rfc3339' ); |
131 |
$dt0 = dt_from_string( '2012-01-01T23:59:00.00Z', 'rfc3339' ); |
| 132 |
cmp_ok( $dt0->epoch(), 'eq', '1325462340', 'dt_from_string handles seconds with 2 decimal places' ); |
132 |
cmp_ok( $dt0->epoch(), 'eq', '1325462340', 'dt_from_string handles seconds with 2 decimal places' ); |
| 133 |
|
133 |
|
| 134 |
$dt0 = dt_from_string( '2012-01-01T23:59:00.000Z', 'rfc3339' ); |
134 |
$dt0 = dt_from_string( '2012-01-01t23:59:59.999z', 'rfc3339' ); |
| 135 |
cmp_ok( $dt0->epoch(), 'eq', '1325462340', 'dt_from_string handles seconds with 3 decimal places' ); |
135 |
cmp_ok( $dt0->epoch(), 'eq', '1325462399', 'dt_from_string handles seconds with 3 decimal places' ); |
|
|
136 |
|
| 137 |
$dt0 = dt_from_string( '2012-01-01T23:59:59.999Z+02:00', 'rfc3339' ); |
| 138 |
cmp_ok( $dt0->epoch(), 'eq', '1325462399', 'dt_from_string handles seconds with 3 decimal places and a timezone' ); |
| 136 |
|
139 |
|
| 137 |
# Return undef if passed mysql 0 dates |
140 |
# Return undef if passed mysql 0 dates |
| 138 |
$dt0 = dt_from_string( '0000-00-00', 'iso' ); |
141 |
$dt0 = dt_from_string( '0000-00-00', 'iso' ); |
| 139 |
- |
|
|