File: 302_format.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 (17 lines) | stat: -r--r--r-- 555 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
my $dt = DateTime->new( year => 1997, month => 10, day => 3,
                        hour => 18, minute => 14, second => 48,
                        time_zone => 'UTC' );
is(unpack("H*", $f->format_datetime($dt)), "4000000034353637",
        '1997-10-3 as string');