CurrentAge() 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 calculated age in the specified unit based on a given input date/time/datetime argument with respect to the current time period of the front time-series enabled map window. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

CurrentAge ( param1, startOrEnd, unit )

param1 (Date/Time/DateTime): First Input argument.

startOrEnd (Logical): Calculate age with respect to start extent of current time period or end extent of time period.
  • TRUE calculates the age based on start extent of current time period.

  • FALSE calculates the age based on end extent of current time period.

unit (String) - Date/Time/DateTime units: Should be based on the type of param1.

Date Units - day, week, month, year, century, decade.

Time Units - hr, min, sec.

Return Value

Float

Description

Returns the calculated age in the specified unit based on a given input date/time/datetime argument with respect to the current time period of the front time-series enabled map window.

Note: If the Map window is not time series enabled, it will return value of 0. If any one of the parameters is null, then value of 0 is returned.

Example

Update RiotsLondonMapped Set Duration = CurrentAge(CommittedFrom, TRUE, "hr") DropIndex Auto