File: parse_datetime3.t

package info (click to toggle)
libdatetime-format-pg-perl 0.16007-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 276 kB
  • sloc: perl: 1,656; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# $Id: $
use Test::More tests => 8;
use DateTime::Format::Pg 0.02;

{
  my $dt = DateTime::Format::Pg->parse_datetime('1221-01-02 03:04:05+01 BC');
  is($dt->year(),            -1220, 'year');
  is($dt->month(),             01, 'month');
  is($dt->day(),               02, 'day');
  is($dt->hour(),              03, 'hour');
  is($dt->minute(),            04, 'minute');
  is($dt->second(),            05, 'second');
  is($dt->nanosecond(),        00, 'nanosecond');
  is($dt->offset(),  (1*60)*60, 'tz offset');
}