<< Click to Display Table of Contents >> Navigation: ThinBASIC Core Language > BuiltIn Functions > Date and Time > cDateTime > cDateTime_Methods > <cDateTime>.NewTime |
Description
Specifies new time component for given cDateTime object.
Syntax
<cDateTime>.NewTime(hour [, minute [, second [, millisecond]]])
Returns
None.
Parameters
Name |
Type |
Optional |
Meaning |
hour |
Numeric |
No |
Hour component of time as number 0 - 23.
|
minute |
Numeric |
Yes |
Minute component of time as number 0 - 59.
If not specified, 0 is presumed.
|
second |
Numeric |
Yes |
Second component of time as number 0 - 59.
If not specified, 0 is presumed.
|
millisecond |
Numeric |
Yes |
Millisecond component of time as number 0 - 999.
If not specified, 0 is presumed.
|
Remarks
Restrictions
Should any of the assigned values be outside of required range, the cDateTime object will remain unchanged.
See also
Examples
' Create an object with current date and time
Dim myDateTime As New cDateTime
' Original form
MsgBox 0, "myDateTime:" + $CRLF + myDateTime.toString
' Modify the TIME
' DATE will not be altered
myDateTime.NewTime(14, 48, 45, 500)
' Modified form
MsgBox 0, "myDateTime modified:" + $CRLF + myDateTime.toString