Depends what you want to do with the time. I use seconds-since-midnight because I need to do some calculations. Data input comes from three spinners that take hours, minutes & seconds and convert them to seconds for storage.
Like Geoff, I have also used seconds since midnight for this. It is relatively easy to convert between the number of seconds and the actual time of day.
Somewhat Like TorturedMind, I use character fields. Mine simply fill with datetime() conversions. This is done on the table and/or form levels:
Simple functions, such as ttoc() and right(), do adequately strip datetime() formats to programatically enter datetime() as time in appropriate character formats, SANS the date portion.
Additionally, user keyboard imputs must validate about 6 or 8 times for: 'am' 'pm' and digit levels on the 24 hour or 12 hour format.
':' is masked into your charactor field on the table and/or form level; so is the 'm' in 'am' and 'pm'
My way is probably not the best way, but it suffices well as a time field.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.