Skip to main content

Search

Search

Return given time range in production date code

Comments

1 comment

  • Avatar
    adam cummick

    I'd try something along the lines of this: Set a variable equal to the current time. Split the result by the ":" characters and take the first chunk(the hour). Put that through some if statements that correspond to your 2 hour increments and sets the value to the appropriate letter. Example:

     

    timeNow = time  'get current time

    timeNowArray = split(timeNow,":")    'separate 4:32:00 into 3 parts

    timeNowHour = CInt(timeNowArray(0))

    if( timeNowHour >= 0 And timeNowHour <2) then

    value = "A"

    else if( timeNowHour >= 0 And timeNowHour <2) then

    value = "B"

     

    And so on until you cover all the times you need. I haven't run this code, so it probably has some sort of syntax error, but it should be a good start!

    1

Please sign in to leave a comment.