Windows Vista Forums

DNS timestamp conversion
  1. #1


    TPGBrennan Guest

    DNS timestamp conversion

    I have a script that writes all the A record information from a DNS server to
    a CSV file. It reports the time stamp used for scavenging in the NT time
    format of hours since 1601. I added a few lines to convert this to a format
    that gives a timestamp value that can be converted using w32tm.exe /ntte to a
    useable date. However, I can not figure out how to make this conversion in
    the VBScript itself. The script returns thousands of records and it is not
    realistic to manually convert each timestamp using w32tm in a separate
    command window. I have heard this issue is resolved with 2008; supposedly it
    returns the timestamp in a real date format. Unfortunately, all of my DNS
    servers still run on 2003



    My question is how can I get all the timestamps to report as useable dates?

      My System SpecsSystem Spec

  2. #2


    Richard Mueller [MVP] Guest

    Re: DNS timestamp conversion


    "TPGBrennan" <TPGBrennan@xxxxxx> wrote in message
    news:18D39157-2A2E-4E8E-8603-98B695889326@xxxxxx

    >I have a script that writes all the A record information from a DNS server
    >to
    > a CSV file. It reports the time stamp used for scavenging in the NT time
    > format of hours since 1601. I added a few lines to convert this to a
    > format
    > that gives a timestamp value that can be converted using w32tm.exe /ntte
    > to a
    > useable date. However, I can not figure out how to make this conversion
    > in
    > the VBScript itself. The script returns thousands of records and it is
    > not
    > realistic to manually convert each timestamp using w32tm in a separate
    > command window. I have heard this issue is resolved with 2008; supposedly
    > it
    > returns the timestamp in a real date format. Unfortunately, all of my DNS
    > servers still run on 2003
    >
    > My question is how can I get all the timestamps to report as useable
    > dates?
    I link examples of two VBScript functions to convert Integer8 (64-bit
    values) to dates here:

    http://www.rlmueller.net/Integer8Attributes.htm

    The second function uses the Exec method of the wshShell object to run
    w32tm. The first does the math manually, including converting to the local
    time zone.

    The Integer8 value is actually the number of 100-nanosecond intervals since
    12:00 am January 1, 1601, in UTC.

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --



      My System SpecsSystem Spec

DNS timestamp conversion problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timestamp value of GINA window presentation Daniel VB Script 0 10 Nov 2009
FTP timestamp and offset Problem Jason Vista General 2 28 May 2009
Difference between Now and the Timestamp on a File gimme_this_gimme_that VB Script 2 11 Feb 2009
Timestamp question rx44 General Discussion 0 18 Sep 2008
Prompt with Timestamp? PS 2007-01-01-23:00:01 C:\WINDOWS> ydroam PowerShell 6 18 Dec 2006