#### ToTime

##### ToTime(number or string)

Use the function IsTime to check whether the number/string is right or not. If the number/string is right, the function returns a Time value between 00:00:00 and 23:59:59, otherwise it will return null.

Parameters

- number - A Number value or expression to be tested for convertibility to a Time value. It can be positive, negative or fractional. It is interpreted as units of 24 hours.
- string - A String value or expression to be tested for convertibility to a Time value. Many forms are accepted.

Return value

Time value or null.

Examples

- `ToTime(0.2)` - Returns 04:48:00.
- `ToTime(-0.2)` - Returns 19:12:00.
- `ToTime(50)` - Returns 00:00:00.
- `ToTime("10:34:25")` - Returns 10:34:25.
- `ToTime("2:25pm")` - Returns 02:25:00.
- `ToTime("2004-2-20")` - Returns 00:00:00.
- `ToTime("24:25:23")` - Returns 00:25:23.
- `ToTime("20*23:25")` - Returns null since the given String format is not time format.

##### ToTime(DateTime a)

This function extracts the time portion from a specified TimeStamp value.

Parameter

a - A TimeStamp value.

Return value

The return value is a Time.

Example

Suppose the date is July 15,1999 and time is 10:55:45. The return value of the following statement is 10:55:45.

`ToTime(ToDateTime(1999, 7, 15, 10, 55, 45 ))`

##### ToTime(Integer t)

This function converts the argument t (A milliseconds value represents the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT) to a Time value.

Parameter

t - A milliseconds value, a DBField value or a parameter. It should be a long integer.

Return value

The return value is a Time.

Example

The return value of the following statement is 08:00:01.

`ToTime(1000)`

Note: When the milliseconds value is larger than 2³², you should use DBField or parameter instead.

##### ToTime(Integer a, Integer b, Integer c)

This function creates a Time value from argument a, b and c.

Parameters

- a - A BigInt value, indicating hours.
- b - A BigInt value, indicating minutes.
- c - A BigInt value, indicating seconds.

Return value

The return value is a Time.

Example

The return value of the following statement is 10:10:10.

`ToTime(10, 10, 10)`