File: tz-num-to-date

package info (click to toggle)
libdatetime-timezone-perl 1%3A0.77.01-1%2B2008c
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,208 kB
  • ctags: 2,636
  • sloc: perl: 3,691; sh: 56
file content (26 lines) | stat: -rwxr-xr-x 356 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl

use strict;
use warnings;

use DateTime;

{
    package FakeCal;

    sub utc_rd_values
    {
        return @{ $_[0] };
    }
}

my $num = shift;

my $days = do { use integer; $num / 86400 };
my $secs = $num % 86400;

my $obj = bless [ $days, $secs, 0 ], 'FakeCal';

my $dt = DateTime->from_object( object => $obj );

print "\n $dt\n\n";