#!/usr/bin/perl
use warnings;
use DateTime;
 
unless (exists($ARGV[0])) {
        print "Supply a ad date\n";
        exit 1;
}
 
my $date = $ARGV[0];
 
$yearsfrom = 1970 - 1601;
$daysfrom = $yearsfrom * 365;
$daysfrom += int($yearsfrom / 4);
$daysfrom -= 3;
$secsfrom = $daysfrom * 24 * 60 *60;
$totalsecs1601 = $date / 10000000;
$totalsecs1970 = $totalsecs1601 - $secsfrom;
$newdate = DateTime->from_epoch(epoch => $totalsecs1970);
 
print join(' ', $newdate->ymd, $newdate->hms) . "\n";
Print/export
QR Code
QR Code sysadmin:scripting:perl:ldapdateto (generated for current page)