File: 303_parse.t

package info (click to toggle)
libdatetime-format-epoch-perl 0.16-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 256 kB
  • sloc: perl: 386; makefile: 2
file content (14 lines) | stat: -r--r--r-- 399 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use strict;
BEGIN { $^W = 1 }

use Test::More tests => 2;
use DateTime;
use DateTime::Format::Epoch::TAI64;

my $f = DateTime::Format::Epoch::TAI64->new( format => 'string' );

isa_ok($f, 'DateTime::Format::Epoch::TAI64' );

# example from http://cr.yp.to/proto/tai64.txt
is($f->parse_datetime("\x40\0\0\0\x34\x35\x36\x37")->datetime,
   '1997-10-03T18:14:48', '1997-10-3 as string');