Is this concept even possible?

Author Message
Rendrago

  • Total Posts : 6
  • Scores: 0
  • Reward points : 0
  • Joined: 4/29/2009
  • Status: offline
Is this concept even possible? Thursday, January 26, 2012 9:40 AM (permalink)
0
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>
 
#1
    Rendrago

    • Total Posts : 6
    • Scores: 0
    • Reward points : 0
    • Joined: 4/29/2009
    • Status: offline
    Re:Is this concept even possible? Thursday, January 26, 2012 11:23 AM (permalink)
    0
    I think I'm just going to make this a scheduled task so this can be considered closed.
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9