jcallen1 Posted February 25, 2016 Share Posted February 25, 2016 What is the simplest way to have program run continuously but start a new log at 7AM that will run to 7PM and then start a new log at 7PM to run to 7AM and have the date and hourly times saved in each? Link to comment Share on other sites More sharing options...
AzeoTech Posted February 25, 2016 Share Posted February 25, 2016 The easiest? In an Event for one of your channels that updates all the time, put: logging.mylog.strFileName = "c:\myData\filePrefix_" + formatDateTime("%y%m%d_%p", systime() - 7 * 3600) Change mylog to the name of your logging set Change the path and prefix inside the quotes to whatever you want. Change the 7 in the part that says 7 * 3600 to the hour in the day you want it to switch, in your case 7am/7pm. This will cause the file name to be stamped with the date, then AM or PM. It will say AM from 7am to 7pm, and PM from 7pm to 7am. This works in US locales. What it does in other locales I cannot say, as it depends on how AM/PM is represented in that locale (country). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.