Time() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

The time function returns the current system time in string format. The time may be returned in 12- or 24-hour time format. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

StringVar = Time( format )

StringVar is a string variable which will be given the system time in hh:mm:ss format, where hh is hour, mm is minutes, and ss is seconds.

format an integer value indicating the format of the string to return. A vlue of 24 returns the time in 24-hour format, any other value returns the time in 12-hour format.

Description

This function is equivalent to calling FormatTime$(CurTime()). Where print Time(12) is the same as FormatTime$(CurTime(), "h:mm:ss") and Time(24) is the same as FormatTime$(CurTime(), "H:mm:ss").

See also:

Date and Time Functions, FormatTime$() function, GetTime() function