HmsToTime Function

Purpose

Returns a date for a specified hour, minute, and second.

Syntax

Date = HmsToTime (hours, minutes, seconds)

hours, minutes, seconds: iexp

Description

To specify a time, such as 11:59:59, the range of numbers for each HmsToTime argument should be in the accepted range for the unit; that is, 0-23 for hours and 0-59 for minutes and seconds. However, you can also specify relative times for each argument using any numeric expression that represents some number of hours, minutes, or seconds before or after a certain time.

Example

OpenW 1

Local a As Date, x%

a = HmsToTime(1000000, 120000, 33000)

Print a

// prints: 03/16/78 21:18:16 or 16/03/1878 21:18:16

Remarks

The format of the output can be changed with the using of Mode Date..., Mode Format..., Format....

See Also

CDate(), Date, Date$, DateAdd(), DateDiff(), DatePart(), DateSerial(), DateTime$(), DateToDmy, DateToDmyHms, DateValue(), Day(), DayNo(), DmyHmsToDate(), DmyToDate(), HmsToTime(), Hour(), IsDate(), Minute(), Month(), Now, Now$(), TimeSerial(), TimeToHms, TimeValue(), Second(), Week(), WeekDay(), Year()

{Created by Sjouke Hamstra; Last updated: 09/10/2014 by James Gaite}