Working With Date and Time Information

 

Storage of Time/Date Values

Datameer X stores and calculates dates as UNIX Time and uses the 1900 date system. Dates are converted into milliseconds (returning the difference between the current time and midnight, January 1, 1970 UTC).

Example 

DateUnix Time Conversion
Jan 1,1970 00:00:011
Jan 1,2016 00:00:011451606401

Constants

A constant is an identifier whose associated value cannot typically be altered by the program during its execution.

ConstantComponent
msmilliseconds
sseconds
mminutes
hhours
ddays

These time constants can be used when building formulas and functions as well as when using filters in order to manipulate time/date data. 

Examples of time/date constants

  1. Functions
  2. Filters
  3. Formulas 

Example of Date/Time constants within functions

*Today is October 10, 2012

Function(s)ResultFunction with constantResult
TODAY()Oct 10, 2012 12:00:00 AMTODAY()-5hOct 09, 2012 07:00:00 PM
TODAY()Oct 10, 2012 12:00:00 AMTODAY()+8h+5mOct 10, 2012 08:05:00 AM
TIMESTAMP()1,349,820,000,000TIMESTAMP()+2d1,349,992,800,000
TIMESTAMP()1,349,820,000,000TIMESTAMP()+45d+12h1,353,751,200,000

Example of Date/Time constant within a filter

Original data:

  1. Apply a filter and choose Advanced.
  2. Type in the filter you want to apply including time constant if needed. For example, #UserDates!Time >= ASDATE("01-05-2012";"MM-dd-yyyy")+5d.
  3. View the data on the filtered sheet.

Example of Date/Time constant within a formula

Original data:

  1. Open a calculation workbook sheet and create your formula, for example: (#UserDates!Time) <= ASDATE("01-05-2012";"MM-dd-yyyy")+48h || (#UserDates!Time) >= ASDATE("01-20-2012";"MM-dd-yyyy")-48h.
  2. View the formula results.

Modifying Date/Time

Modify values with a data date type using the ADDTODATE function. This function allows for both adding and subtracting from dates and times and takes daylights savings time and leap years into account. 

Operators (+/-) outside the ADDTODATE function aren't supported.