$ bc 2002-1601 401 401*365*24*60*60*10^7 126459360000000000
There are functions to do this conversion buried in the internals of OLE::Storage and OLE::Storage_Lite and perhaps in some other Win32 modules as well. But you could roll your own conversion with Date::Calc:
#!/usr/bin/perl -wl use strict; use Date::Calc 'Add_Delta_DHMS'; my $vt_filetime = '126697423010137600'; # Disregard the 100 nanosecond units (rounding might be better) $vt_filetime = substr($vt_filetime, 0, 11); my $days = int( $vt_filetime / (24*60*60) ); my $hours = int( ($vt_filetime % (24*60*60)) / (60*60) ); my $mins = int( ($vt_filetime % (60*60)) / 60 ); my $secs = $vt_filetime % 60 ; my @date = Add_Delta_DHMS(1601, 1, 1, 0, 0, 0, $days, $hours, $min +s, $secs); # Format @date as you wish print "@date"; __END__ Prints: 2002 6 28 12 51 41
--
John.
In reply to Re: Active Directory ldifde() time format conversion question
by jmcnamara
in thread Active Directory ldifde() time format conversion question
by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |