qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
TIME$ Function and Statement
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
The TIME$ function returns the computer's current system time.
The TIME$ statement sets the current system time on your computer.
 
TIME$
TIME$ = stringexpression$
 
    ■ stringexpression$    The time in one of the following forms:
                             hh          Sets the hour; minutes and seconds
                                         default to 00.
                             hh:mm       Sets the hour and minutes; seconds
                                         default to 00.
                             hh:mm:ss    Sets the hour, minutes, and seconds.
 
    ■ The TIME$ function returns a string in the form hh:mm:ss.
 
Example:
    PRINT TIME$
    TIME$ = "08:00:58"    'Note: The new system time remains in effect until
                          '      you change it again.
    PRINT "Time set to "; TIME$
 
See Also    DATE$