InsectGrain Posted July 19, 2010 Share Posted July 19, 2010 Hello, In my script, i need to compare 2 or more date/times... the newest will be highlighted in the gui... I have looked through the forum and i have only founded on how to compare 2 files like using "_Date_Time_CompareFileTime". Please help Link to comment Share on other sites More sharing options...
evilertoaster Posted July 19, 2010 Share Posted July 19, 2010 What format are your date/times in? There are several conversion options within the Date.au3 UDF, but it depends what your initial format is. Link to comment Share on other sites More sharing options...
InsectGrain Posted July 20, 2010 Author Share Posted July 20, 2010 ; add Date $Time = FileGetTime($sLine, 0, 0) $Month = $Time[1] $Day = $Time[2] $Year = $Time[0] $Hour = $Time[3] $Minutes = $Time[4] GUICtrlSetData($List2, " <-----Date modified: " & $Month & "/" & $Day & "/" & $Year & " at: " & $Hour & ":" & $Minutes, 1) EndIf I'm not sure what you mean by format.... Link to comment Share on other sites More sharing options...
JohnOne Posted July 20, 2010 Share Posted July 20, 2010 Can you not use the macros @Hour, @Min etc...? $a = @SEC Sleep(1000) $b = @SEC If $b > $a Then MsgBox(0,"","$b is newer") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
InsectGrain Posted July 20, 2010 Author Share Posted July 20, 2010 Can you not use the macros @Hour, @Min etc...? $a = @SEC Sleep(1000) $b = @SEC If $b > $a Then MsgBox(0,"","$b is newer") I don't understand, why would I need the system time? Link to comment Share on other sites More sharing options...
JohnOne Posted July 20, 2010 Share Posted July 20, 2010 I dont know. Just had a moment. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
czardas Posted July 20, 2010 Share Posted July 20, 2010 (edited) When you say the newest, do you mean the most recently created or modified? Sorry I see from your example you mean modified. You can concatonate the array elements like this. $lastMod = $time[0] & $time[1] & $time[2] & $time[3] & $time[4] & $time[5] Then the largest nmber will be the most recent. Or you can set the format to 1 which does the same thing. Edited July 20, 2010 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
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