Hello
I'm after a bit of help please in regards to the best way to handle a issue i have with a small "app" Ive inherited...
this is a small PowerShell GUI/code which controls a handover document for a 3 shift rota system (i.e days, eves, nights). Each day we create 3 text files into a dated subfolder which are then edited throughout each shift via the "app" and then reviewed/updated etc and archived the next morning where the cycle starts again.
my "problem" is with the night shift handover in that the file /folder is created for "today" (i.e. 20200619) at the start of each day when the day shift starts (07:00) which is fine but the night shift itself then starts at 23:00 and goes on until 07:00 the next day. When they start they open the current days file but once it hits midnight, it then tries to open the folder/file for the following date ie. the one dated 20200620 which doesnt exist.
Weve tried pre-allocating the day ahead but this then means that we may have part of the handover saved in the 20200619 file and part after midnight in the 20200620 file...weve tried checking/comparing the time
too and whilstt this made it a bit better when they keep the app active, if the apps restarted after midnight all the dates shifted again and we were back to square 1...
Current thinking is to now save the date into another external file when the logs are created and read this date each time to retrieve the right file but wonder if anyone can suggest a possible alternate soltution please.
Apologies but I'm unable to publish any of the code due to "security" restrictions in place (and understand that this may restrict any help or responses I receive but all will be appreciated...)
Regards
PaulSc
I'm after a bit of help please in regards to the best way to handle a issue i have with a small "app" Ive inherited...
this is a small PowerShell GUI/code which controls a handover document for a 3 shift rota system (i.e days, eves, nights). Each day we create 3 text files into a dated subfolder which are then edited throughout each shift via the "app" and then reviewed/updated etc and archived the next morning where the cycle starts again.
my "problem" is with the night shift handover in that the file /folder is created for "today" (i.e. 20200619) at the start of each day when the day shift starts (07:00) which is fine but the night shift itself then starts at 23:00 and goes on until 07:00 the next day. When they start they open the current days file but once it hits midnight, it then tries to open the folder/file for the following date ie. the one dated 20200620 which doesnt exist.
Weve tried pre-allocating the day ahead but this then means that we may have part of the handover saved in the 20200619 file and part after midnight in the 20200620 file...weve tried checking/comparing the time
too and whilstt this made it a bit better when they keep the app active, if the apps restarted after midnight all the dates shifted again and we were back to square 1...
Current thinking is to now save the date into another external file when the logs are created and read this date each time to retrieve the right file but wonder if anyone can suggest a possible alternate soltution please.
Apologies but I'm unable to publish any of the code due to "security" restrictions in place (and understand that this may restrict any help or responses I receive but all will be appreciated...)
Regards
PaulSc