I need to save a .csv file, inserting the saving time (HH) in the name, but…
for technical reasons, the first RUN of the day (h: 8: 00) is sometimes completed late.
for this reason, I have to anticipate the draw, starting at 7:30 in the morning, so that by 8:00 - 08:15 it will be ready.
What is needed:
- if the run is completed before 8:00, I have to add 1h to the file name.
- if the run is completed after 8:00, I can use the current time.
I don’t know how to add a string that calculates the correct time.
ex: if before 8:00 am = “namefile_now.tostring (” ddMMyyyy_HH ") + add 1h .csv
ex: if after 08:00 “namefile_now.tostring (” ddMMyyyy_HH ").csv
Can anyone kindly help me with this?
Thanks a lot!