1. ## Need solustion logic

Hi Team,

My problem is:

In My application they have fixed list of appoint time like in drop down... 9:00,9:15,9:30,9:45,10:00,10:15,10:30,etc....

if my system current time is 9:44

script need to select drop down value 9:45

if my system current time is 10:15
script need to select drop down value 10:30

please let me know the implement solustion

Regards,
Kishore

2. Any solution above clarification

3. Hi Kishore,
I think first you need to separate the minutes away from the hours. Split on the colon and take the second element of the array. Or do it another way.

Step 2. Determine which quarter of the hour you are on. 0 to 15 is Quarter 1. 16 to 30 is q3. 31 to 45 is q3. 46 to 59 is q4. You may need to adjust the rules.

Step 3. If it is q4, you may need to advace the hour by 1. If hour is 23, you need to go back to 00: as the hour.
This step can be done with a case statement, if then logic, maybe regular expression.

Step 4. Concatenate the hour with the quadrant.

Let me know if you want to go through the code on this. I have done similar time date logic before. It takes tweaking but it is not that bad.

Thanks,
Kevin

4. Not sure if you are using 24 hour clock or not, but this should help:
Code:
```Sub Runner()
MsgBox changeTime("13:00")
End Sub
Function changeTime(myTime)
myTime = Split(myTime, ":")
Select Case CInt(myTime(1))
Case Is >= 45
myTime(0) = myTime(0) + 1
If myTime(0) = 13 Then myTime(0) = 1
If myTime(0) = 25 Then myTime(0) = 0
myTime(1) = 0
Case Is >= 30
myTime(1) = 45
Case Is >= 15
myTime(1) = 30
Case Is >= 0
myTime(1) = 15
Case Else
End Select
changeTime = Right("0" & myTime(0), 2) & ":" & Right("0" & myTime(1), 2)
End Function```

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.