Skip to content
Paul Squires edited this page Oct 19, 2026 · 2 revisions

Home › Date and Time Functions › Time

Time

Returns the current time as text in the form hh:mm:ss.

Syntax

Declare Function Time ( ) As String

Description

Returns the current system time in the format hh:mm:ss.

Return Value

Returns the current system time.

Remarks

Usage

result = Time[$]

Differences from QB

  • The QB TIME statement (to set the system time) is now called SetTime. The string type suffix "$" is required in the -lang qb dialect.
    The string type suffix "$" is optional in the -lang fblite dialect.
    The string type suffix "$" is ignored in the -lang fb dialect, warn only with the -w suffix compile option (or -w pedantic compile option).

See also

Examples

Print "the current time is: "; Time


Category: Date and Time Functions
Kind: function


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally