microera Posted August 30, 2009 Share Posted August 30, 2009 Hi How to write script to get simple integer in sec.? difference_time = time_of_created_file - _now() p.s. i see only complicated procedures..... Link to comment Share on other sites More sharing options...
Jfish Posted August 30, 2009 Share Posted August 30, 2009 I have not tested this, but something like this should probably work: #Include <Timers.au3> Local $starttime = _Timer_Init(FileGetTime ( "filename" [, option [, format]] )) _Timer_Diff($starttime) Hi How to write script to get simple integer in sec.? difference_time = time_of_created_file - _now() p.s. i see only complicated procedures..... Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 30, 2009 Moderators Share Posted August 30, 2009 microera,It is not that complicated:) :#Include <Date.au3> ; get file time $aFile_Time = FileGetTime("Your file name") ; put it in correct format $sFile_Time = $aFile_Time[0] & "/" & $aFile_Time[1] & "/" & $aFile_Time[2] & " " & $aFile_Time[3] & ":" & $aFile_Time[5] & ":" & $aFile_Time[5] ; use function to get difference in secs $nSecs = _DateDiff("s", $sFile_Time, _NowCalc()) ; show the results! ConsoleWrite($sFile_Time & @CRLF & _NowCalc() & @CRLF & $nSecs & @CRLF)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
microera Posted August 30, 2009 Author Share Posted August 30, 2009 (edited) _Now() is nothing complicated! only one mistake ... instead: $sFile_Time = $aFile_Time[0] & "/" & $aFile_Time[1] & "/" & $aFile_Time[2] & " " & $aFile_Time[3] & ":" & $aFile_Time[5] & ":" & $aFile_Time[5] ok is: $sFile_Time = $aFile_Time[0] & "/" & $aFile_Time[1] & "/" & $aFile_Time[2] & " " & $aFile_Time[3] & ":" & $aFile_Time[4] & ":" & $aFile_Time[5] you see diference? Edited August 30, 2009 by microera Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 31, 2009 Moderators Share Posted August 31, 2009 microera, As you are now so good at this, I will let you write your own code next time . M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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