Date

 

Date Overview

The Date native type is a container, which may hold a Date and Time of Day. Analytic Information Server supports Dates in the range of 1015BC to 1015AD. This range exceeds the approximate current age of the universe by a factor of 1000. At the extreme ends of the Date range (1015BC or 1015AD), Time of Day can be accurately recorded in Days only. At the center of the date range (104BC or 104AD) Time of Day can be accurately recorded in microseconds.

Using the date value, you can perform calendar math and display dates in many different formats. Some date functions require you to enter arguments as date values; others require that date arguments be specified in text form.

When to Use

The Date native type is used to save Date or Time of Day values

Constant Form

Date constants are written as #Month,Day,Year . The # symbol is mandatory; each date component is separated by a comma and no spaces are allowed.

 

#Dec,12,1993 #Jan,13,56BC #Feb,28,1994 #Jun,15,1876 #Jul,14,1786:6:10:30

The valid month abbreviations are: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec. The day must be valid for the specified month. The spelling of the months are case-sensitive. The year must contain all of its digits. If the year is before Christ, it must be followed by the initials BC.

An alternate form allows period symbols instead of commas as in #Month.Day.Year.

#Dec.12.1993 #Jan.13.56BC #Feb.28.1994 #Jun.15.1876 #Jul.14.1786:6:10:30

Native Data Type

The Boolean Data Type is an example of an AIS Native Data Type.

Analytic Information Server stores all of its Native Data Types in Virtual Machine Containers. All containers are stored in memory. Containers provide the basic storage mechanism for modeling data of all types. Containers provide these fundamental characteristics:

Ability to hold any type of data (including code) at any time.

Ability to know what type of data is contained.

Ability to be stored, retrieved and evaluated by the system.

Ability to handle type conversion, and memory management automatically.

Containers come in two sizes, Large and Small. Small containers are six bytes in length, and large containers are ten bytes in length. Large containers can store larger amounts of data immediately and place less of a burden on the Heap manager. Small containers require less immediate space, but place more of a burden on the Heap manager.

Large containers can store the following data types immediately and does not require the services of the Heap manager:

Small containers can store the following data types immediately without placing additional burden on the Heap manager:

Analytic Information Server containers can be saved and loaded to and from persistent (database) storage at any time. Containers with immediate data are saved on disk in fixed length records equal to the size of the container. Containers with Heap object references are saved in fixed length records, which are automatically expanded to include the contents of the Heap object, and any objects referenced by the Heap object, etc. This feature is called Object Closure Management and is automatic with every Analytic Information Server container database save. Analytic Information Server containers may be loaded from any database repository record at any time. If the data in the record is immediate, the database load fills the container with the immediate data. If the data in the record is an object closure, the database load fills the container with a Heap object reference, and all of the objects in the record are loaded back into the Heap with the same referential relationships they had when they were saved.

 

Data Type Functions

The Date object can be demonstrated by the following functions.

addMethod compareEQ compareGE compareGT
compareLE compareLT compareNE compare
comparison date day days360
defmethod getTickCount hour isDate
isEqual isIdentical isType julian
methodsOf minute month now
ref second send setq
sizeof time today type
year

 

Data Type Examples

The Date object can be demonstrated by the following examples.

Example_Date_addMethod_015 Example_Date_addMethod_016 Example_Date_compareEQ_012 Example_Date_compareGE_012
Example_Date_compareGT_012 Example_Date_compareLE_012 Example_Date_compareLT_012 Example_Date_compareNE_012
Example_Date_compare_012 Example_Date_comparison_011 Example_Date_date_001 Example_Date_day_001
Example_Date_days360_001 Example_Date_defmethod_015 Example_Date_getTickCount_001 Example_Date_hour_001
Example_Date_isDate_001 Example_Date_isEqual_010 Example_Date_isEqual_011 Example_Date_isIdentical_010
Example_Date_isType_014 Example_Date_julian_001 Example_Date_methodsOf_015 Example_Date_minute_001
Example_Date_month_001 Example_Date_now_001 Example_Date_ref_020 Example_Date_second_001
Example_Date_send_013 Example_Date_setq_019 Example_Date_sizeof_012 Example_Date_time_001
Example_Date_time_002 Example_Date_today_001 Example_Date_type_014 Example_Date_year_001