lgvlgv Posted September 23, 2013 Share Posted September 23, 2013 How to u get only "hour:min" from system and compare it with time=hour:min in a inifile? ex.. time=18:00 I keep getting lost when it comes to time functions. //Regards L Link to comment Share on other sites More sharing options...
water Posted September 23, 2013 Share Posted September 23, 2013 @HOUR & ":" & @MIN My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
somdcomputerguy Posted September 23, 2013 Share Posted September 23, 2013 (edited) The macros @HOUR & @MIN, as well as the functions IniRead & StringInStr could probably be used to accommodate you here. edit: oh I'm a slow typer! Edited September 23, 2013 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
lgvlgv Posted September 23, 2013 Author Share Posted September 23, 2013 The macros @HOUR & @MIN, as well as the functions IniRead & StringInStr could probably be used to accommodate you here. edit: oh I'm a slow typer! i was thinking that but wasent sure when comparing they would be the same format or if one was just text and the other some date/time format? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted September 23, 2013 Share Posted September 23, 2013 Look at water's post (#2) to put the time macros and the : character in the desired format. The macros would be creating a string, and a string would be read from the file. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
water Posted September 23, 2013 Share Posted September 23, 2013 As soon as you concatenate numbers with a character (":") the result is a string. IniRead returns a string too. So no problem when comparing. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
lgvlgv Posted September 24, 2013 Author Share Posted September 24, 2013 If i vant to convert it, what do i do? i would like to stop some services between lets say 03:00 and 07:00, the rest of the time its ok to run. Link to comment Share on other sites More sharing options...
kylomas Posted September 24, 2013 Share Posted September 24, 2013 lgvlgv, Convert what? This will do something once every day between 03:00 and 07:00. local $flag = false ; used to do action once while 1 if (@hour >= 03 and @hour <= 07) and $flag = false then $flag = true ; ; do your thing ; EndIf sleep(1000) if (@hour < 03 or @hour > 07) and $flag then $flag = not $flag wend kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill 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