<< Click to Display Table of Contents >> Navigation: ThinBASIC Core Language > BuiltIn Functions > Date and Time > cDateTime > cDateTime_Methods > <cDateTime>.SecondsToDate |
Description
Sets time part of cDateTime based on passed number of seconds.
It does not alter date in any way, only time.
Syntax
<cDateTime>.SecondsToDate(seconds)
Returns
None.
Parameters
Name |
Type |
Optional |
Meaning |
seconds |
Numeric |
No |
Value in seconds, 0 - 86399 |
Remarks
If the value is < 0, the time is not updated.
If the value is > 86399, modulo of value and 86400 is used to update the time (86401 becomes 1 second in time).
Restrictions
See also
Examples
' Create an object with current date and time
Dim firstDateTime As New cDateTime
MsgBox 0, "Original date/time: " + firstDateTime.toString
' Altering the time component with 70 seconds input
firstDateTime.SecondsToDate(70)
' Altered object will have time component 00:01:10.000, as 70 seconds is 1 minute and 10 seconds
MsgBox 0, "Altered date/time: " + firstDateTime.toString