Jump to content

Comparing 2 or more date/time


Recommended Posts

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

; 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

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 by czardas
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...