The number of seconds past midnight.
One of the following formats.
- Format Parameter Value
The number of decimal places for seconds. The integer value can be from 0 to 3.
Returns the formatted time value.
Converts a time value to a formatted time character string.
TOTIME() returns a formatted character string containing a time based on the specified number of seconds past midnight. The resulting formatted string can be in one of seven formats specified by the format code, and can contain up to three decimal places for seconds.
? totime(125, 2, 0) = "0:02:05" ? totime(863.5, 12, 1) = "0:14:23.5 AM"
You may often need to compute an event's ending time, given the event's start time and duration. For example, assume that an event's start time is stored in START and the event duration (expressed as hh:mm) is stored in DURATION. You can use the following expression to return the time that the event ended:
totime((toseconds(START) + toseconds(DURATION), 1, 0)
If you have imported a time value from Microsoft Excel as a character or numeric value and you wish to convert it to a Short Time value, the following expressions will do the job.
dim dat as C dat = .345 ? totime((val(dat) * 86400),1,0) = "8:17" dim dat2 as N dat2 = .345 ? totime(dat2 * 86400,1,0) = "8:17"