This should roughly get you to the current value within the second. It is perl.
 
my $ct=time();
$ct+=11644473600;
print $ct."0000000\n";
 
Looks something like:
 
F:\temp>timetest.pl
127815039540000000
 
[Wed 01/11/2006 20:45:54.59]
F:\temp>w32tm /ntte 127815039540000000
147934 01:45:54.0000000 - 1/11/2006 8:45:54 PM (local time)
 
[Wed 01/11/2006 20:46:02.50]

It is basically the opposite of a post I sent to this list back in Nov 2004 and a few other places...
 
 
 
 
 
 
 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sitton Glen E
Sent: Wednesday, January 11, 2006 8:25 PM
To: [email protected]
Subject: [ActiveDir] OT: NT epoch time value of "now"

Anyone know of a command or utility to spit out the long-integer datetime value of "now"?  I'm looking for the long-integer of the ANSI datetime value (NT epoch time since 1/1/1601).
 
A script that converts the friendly datetime of "now" to NTTE would work.  I've hunted and can't find anything.
 
Thanks!
 
Glen Sitton
IRS Active Directory Team
Modernization & Information Technology Services

Reply via email to