SetTime

FreeBASIC

SetTime
 
Sets the current system time

Syntax

Declare Function SetTime ( ByRef newtime As Const String ) As Long

Usage

result = SetTime( newtime )

Parameters

newtime
the new time to set

Return Value

Returns zero on success or non-zero on failure on all ports except DOS.

Description

To set the time, format the date and send to Settime in one of the following formats: "hh:mm:ss", "hh:mm", or "hh" (hh is the hour, mm is the minute, and ss is the second).

Example

SetTime "1:20:30"


Differences from QB

  • The Time statement was used QB and the syntax was TIME = newtime.

See also