+ Post New Thread
Results 1 to 3 of 3
Windows Thread, Issue with %time% variable in Technical; I have a line in our logon script which is really useful. It is: echo %date%,%time%,%username%,%computername%,%logonserv er% >> \Fp4\ShApps\pcaudit\logonlist2.csv This ...
  1. #1
    kennysarmy's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,286
    Thank Post
    80
    Thanked 45 Times in 31 Posts
    Rep Power
    30

    Issue with %time% variable

    I have a line in our logon script which is really useful.

    It is:

    echo %date%,%time%,%username%,%computername%,%logonserv er% >> \\Fp4\ShApps\pcaudit\logonlist2.csv

    This then creates a log which we can refer to in disputes! and also we can use it to see how often certain PC's are actually being used.

    The problem I have is with the %time% variable once I open the CSV in excel (or other).

    Some show as:

    9:54:37.48 = which I take to mean 9.54am
    There are also a few which start with an 8, such as:
    8:07:30.03 = which I take to mean 8.07pm

    However the majority are shown with less figures:
    Ranging from:
    00:00:08 to 00:59:40

    So I can little confused how the %time% variable relates to the real time....

    Anyone shed any light on this?

  2. #2

    X-13's Avatar
    Join Date
    Jan 2011
    Location
    /dev/null
    Posts
    9,033
    Thank Post
    591
    Thanked 1,945 Times in 1,345 Posts
    Blog Entries
    19
    Rep Power
    813
    I just tried "echo %time%"

    and got 14:09:09.75 [Which will be wrong by now]

    So, it's Hour:Minute:Second.Hundreths

  3. #3
    kennysarmy's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,286
    Thank Post
    80
    Thanked 45 Times in 31 Posts
    Rep Power
    30
    I've been able to solve it by renaming the file as a TXT file and then importing in to Excel - otherwise it loses the formatting somehow.

    Also some times have less details:

    7:01:31.87 v 11:29

    So in excel I've been able to use a similar command to : =LEFT(F9,LEN(F9)-9) to get all times the same.

    I wonder if some PC's return the %time% variable differently or if certain times are reported differently - bit weird.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 26
    Last Post: 28th July 2012, 09:01 PM
  2. Replies: 12
    Last Post: 4th May 2011, 06:23 PM
  3. VLK Validation Issues with WGA
    By plexer in forum IT News
    Replies: 4
    Last Post: 16th July 2007, 07:30 AM
  4. Issues with two new Dell PC's mapping drives.
    By tosca925 in forum Wireless Networks
    Replies: 1
    Last Post: 18th January 2007, 12:13 AM
  5. Replies: 2
    Last Post: 6th December 2006, 06:23 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •