Description

Returns the time of day, in internal storage format.

Note: Time is stored as a decimal when it is defined as a part of Date Time format.

Syntax

time = Time()

Parameters

The Time function returns the string value of the internal time of day. Internal time is calculated as the number of seconds past midnight.

For example, if Time() were used at 10:30:12 (approximately 10:30 AM), it would return the internal time of 37812 seconds after midnight.

The following table shows the number of seconds for common times:

ExternalInternal
Midnight0
6:00 AM21600
Noon43200
One hour3600

Note: The data that is returned is the local workstation data.

See also

IConv (MT)OConv (MT)TimeDate()Date()

Example

* The string value of internal time is assigned to Clock.
Clock = Time()
* Program branches to afternoon if more than 43200 seconds have passed since midnight.
If Time() GT 43200 Then
  GoSub afternoon
End
  • No labels