Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verify times on quarter hour

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I need to verify that a text time entry (I know there's the time entry component, but nobody liked that one, they would rather type in a text form of the times) from a user input ends on the quarter hour. I know that I can split the entry apart and check the last two digits for 15, 30, 45 or 00, but was wondering if there's a different/better way.

Any ideas?

thanks!

leslie
 

Assuming you have converted the input to a TDateTime, multiply by 4 and see how close the fractional part is to zero or 1 (like less than .00004 or greater than .99996)

See function Frac().



 
thanks I'll look into that after lunch!

les
 

Actually, I think I did that too fast. Multiply by 4 will give you quarter days.

Try multiplying by 96 (4 x 24) to get it to quarter hours.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top