CitectVBA Programming Reference > Understanding CitectVBA Language Basics > Date and Time Handling > Date Data Type Structure

Date Data Type Structure

The date data type structure in CitectVBA is a junction of two very different methods of data storage. It is formed from the serial concatenation of a date-value followed by a time-value, separated by a floating point, and stored in an 8-byte floating-point date data type value.

The integer (date-value) portion (to the left of the floating point) and the remainder (time-value) portion (to the right of the floating point) must be handled differently as they are structured very differently. CitectVBA has a number of pre-defined date and time functions to convert between the internal floating-point date data type format and visibly recognisable dates and times.

Note: Dates in CitectVBA are based upon the Gregorian Calendar.

For example, the date and time of 5/22/97 at 3:00 p.m. would be stored in CitectVBA as 35572.625 representing the 35572 days since 12/30/1899, and 3:00 p.m. as 625/1000 of a full day.

Note: Don't confuse Date data types used in CitectVBA with date and time values used in Windows, DLLs, CitectSCADA, or in Cicode. For instance, CitectSCADA stores time/date-related variables as a single integer representing the number of seconds since 01/01/1970.