GetDate() 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

Returns the Date component of a DateTime. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

GetDate( DateTime )

Return Value

Date

Example

This example sets the date and time as a string in dd/mm/yyyy (where dd is day, mm is month, and yyyy is year) and hh:mm:ss.fff (where hh is hours, ss is seconds, mm is minutes, and fff is fractions) format and then converts the string using the GetDate() function.

dim dtX as datetime
dim Z as date
dtX = "03/07/2007 12:09:09.000 AM"
Z = GetDate(dtX)
Print FormatDate$(Z)

See Also:

Date and Time Functions, GetTime() function