kennysarmy Posted November 28, 2012 Posted November 28, 2012 I have a line in our logon script which is really useful. It is: echo %date%,%time%,%username%,%computername%,%logonserver% >> \\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?
X-13 Posted November 28, 2012 Posted November 28, 2012 I just tried "echo %time%" and got 14:09:09.75 [Which will be wrong by now] So, it's Hour:Minute:Second.Hundreths
kennysarmy Posted November 28, 2012 Author Posted November 28, 2012 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now