How does spreadsheet function GetDate() work in Statistica?
book
Article ID: KB0073039
calendar_today
Updated On:
Products
Versions
Spotfire Statistica
13.4 and later
Description
Statistica spreadsheet function GetDate() can convert values to a Date data type.
How does it work to convert values to date?
Environment
Windows
Resolution
1. When reading a Date data type with GetDate(), the Date data are stored as Julian date values (e.g. 44348, 44201) at the background of the application.
GetDate(Date) reads the Julia date values of that date and can convert it to a date correctly, regardless of the Regional date format used in the user's machine.
2. When reading a text string value (not of Date type) with GetDate() function, the text string is ambiguous to GetDate() which date format it is using.
In earlier versions like 13.1, 13.2, 13.3.0, and 13.3.1, the application GetDate(StringText) will always read the string text value based on United States Date format, that is, MM-DD-YYYY where the Month comes before Day. Even when you are using other Non-US Regional Date format, it will still read according to US Date Format MM-DD-YYYY.
For example, GetDate("01-06-2021 09:44:32") will read as 6 Jan 2021 in version 13.2, where Month "01" comes before Day "06". (Here "01-06-2021 09:44:32" is a text string and not of a date type. )
In newer versions including 13.4, 13.5, 13.6 and 14.0, GetDate(StringText) has been modified to read the string text (ambiguous date format) with respect to the Regional Date Format of the user's machine. That is, GetDate("01-06-2021 09:44:32") will read as 6 Jan 2021 if the user is using US regional date format (MM-DD-YYYY) where Month comes before Day. GetDate("01-06-2021 09:44:32") will read as 1 Jun 2021 if the user is using a Non-US regional date format (DD-MM-YYYY) where Day comes before Month, for example, English (India).
Therefore, when using GetDate() function to process text string values to date, user should be aware of the Regional Date Format used in the machine, and if necessary, would need to manipulate the text string values in order to get the correct date output from GetDate() function.
Issue/Introduction
How does spreadsheet function GetDate() work in Statistica?