File: tz-num-to-date

package info (click to toggle)
libdatetime-timezone-perl 1:1.20-1+2010k
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,508 kB
  • ctags: 2,667
  • sloc: perl: 2,340; sh: 68; makefile: 5
file content (25 lines) | stat: -rwxr-xr-x 352 bytes parent folder | download | duplicates (7)
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
#!/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";