Time Question...!

1. tt
Member
Join Date
Dec 1969
Posts
46

## Time Question...!

Hi!<BR>I&#039;ll feel wery stupid now but i need help with formatting a sequense from 1 to 24 to an accurate time object.<BR>Example:<BR>I´ll get an integer like 2 and want to format that so I&#039;ll can compare it to the accurate time and then if the integer is equal or one step bigger then the accurate time I&#039;ll fire an event.<BR>Hope You´ll understand what I´ll mean!<BR>Best // TT (tt@wineasy.se)<BR>

2. Senior Member
Join Date
Dec 1969
Posts
96,118

## tick tock talk...

I&#039;m curious as to how you will "fire an event", but...<BR><BR>So if the integer is 14 and the time is between 2:00 PM and 3:59 PM you want to fire the event???<BR><BR>Okay...<BR><BR>&#060;%<BR>theNumbe r = ... 1 to 24 ...<BR>If theNumber = theNumber MOD 24 &#039; hours are in range 0 to 23, only!<BR>theHour = Hour( Now( ) )<BR>If theHour = theNumber OR theHour+1 = theNumber THEN<BR>&nbsp; &nbsp; ... FIRE! ...<BR>End If<BR>%&#062;<BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
96,118

## Nope...that was a wrong answer!

If theHour is 23, then (theHour+1) will be 24, and it will never match with theNumber!<BR><BR>So let&#039;s do it smarter:<BR><BR>&#060;%<BR>theNumber = ... 1 to 24 ...<BR>If theNumber = theNumber MOD 24 &#039; hours are in range 0 to 23, only!<BR>theHour = Hour( Now( ) )<BR>If theHour = theNumber OR ( (theHour+1) MOD 24) = theNumber THEN<BR>&nbsp; &nbsp; ... FIRE! ...<BR>End If<BR>%&#062;<BR>

4. tt
Member
Join Date
Dec 1969
Posts
46

## RE: tick tock talk...

Hi Wilkinson!<BR>Thanks!<BR>Your simple sentense "theHour = Hour( Now( ) )" solved my problem...!<BR>Thanks again!<BR>Best // TT<BR>

#### Posting Permissions

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