Before I even attempt to work on this code, I wanted to see if you guys think it's even possible:
Let's say there are three 24-hour shifts from 8AM to 7:59:59 the next day (1Unit, 2Unit and 3Unit). This reoccurs forever and never changes. Can I calculate what shift it is based on the current date and time?
Basically I would run this script and it would create a text/Excel file that just has one entry in it. The current shift.
I can do this without the times but the whole 8AM to 7:59:59 is confusing the heck out of me.
startDate=CDate("2012/01/25") todayDate=CDate("2012/02/16") daysPassed=(DateDiff("d",startDate,todayDate)) remainder = (daysPassed - 1) mod 3 if remainder = 0 then WScript.Echo "2 Unit" elseif remainder = 1 then WScript.Echo "3 Unit" elseif remainder = 2 then WScript.Echo "1 Unit" End If Thank you!
PS: How do I post code and retain my carriage returns?
<message edited by Rendrago on Thursday, January 26, 2012 10:37 AM>