CreateTime()
Summary
Creates a DateTime compound variable with just a time.
Changes
Added to Version 2013.
Syntax
datetime = CreateTime([int hour, int minute, int second, int millisecond])
| Argument | Contents |
|---|---|
| hour | Hour number in 24-hour format |
| minute | Minute number |
| second | Second number |
| millisecond | Millisecond number |
Returns
A DateTime compound variable with missing date properties.
Notes
-
All arguments are optional, but you must have the correct number of leading commas for the minute, second, and millisecond arguments.
-
If all arguments are null, or no arguments are supplied, CreateTime() returns the current time.
-
The day, month, and year properties of the DateTime compound variable will be null.
-
For more information on DateTime compound variables, see Compound Variables.
Examples
dt = CreateTime(11,22,19,48)
ShowArray({dt})
ShowMessage(i2s(dt.millisecond))
dt = CreateTime()
ShowMessage("The time is " + FormatDateTime(dt,))
See Also
| Function | Summary |
|---|---|
| CreateDate() | Creates a DateTime compound variable with just a date |
| CreateDateTime() | Creates a DateTime compound variable |
| FormatDateTime() | Formats a DateTime compound variable |
| ParseDateTime() | Parses a string to create a DateTime compound variable |