Windows Thread, Issue with %time% variable in Technical; I have a line in our logon script which is really useful.
echo %date%,%time%,%username%,%computername%,%logonserv er% >> \Fp4\ShApps\pcaudit\logonlist2.csv
28th November 2012, 02:49 PM #1
Issue with %time% variable
I have a line in our logon script which is really useful.
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:
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?
IDG Tech News
28th November 2012, 03:09 PM #2
I just tried "echo %time%"
and got 14:09:09.75 [Which will be wrong by now]
So, it's Hour:Minute:Second.Hundreths
28th November 2012, 03:36 PM #3
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.
By Cataclismic in forum How do you do....it?
Last Post: 28th July 2012, 10:01 PM
By cheshireguy2001 in forum Mac
Last Post: 4th May 2011, 07:23 PM
By plexer in forum IT News
Last Post: 16th July 2007, 08:30 AM
By tosca925 in forum Wireless Networks
Last Post: 18th January 2007, 01:13 AM
Last Post: 6th December 2006, 07:23 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)