| Paradox Date, Time, and DateTime Data Types: Introduction and Internal Formats |
|
|
|
| Contributed by Rick Kelly | |
| 23 June 2001 | |
|
Get ready for this series on dates by checking out part 1: Introduction and Internal Formats!Paradox® Date, Time, and DateTime Data Types Introduction and Internal Formats © 2001 Rick Kelly www.crooit.com Download the library containing the routines used in this series. Preface Time is represented in Paradox as:
The following definitions will form the basis of the presented OPAL methods in later sections. Date In OPAL, you can externally represent Date values in either month/day/year, day-month-year, or day.month.year format as determined by the formatSetDateDefault method (System type), or by custom OPAL formatting statements for other external representations. Internally, Date values are stored as long integers representing the number of days since January 1 of year 1 which is day 1. The span of dates supported is an incredible May 4, -30799 (-2,147,483,648) to July 11, 18629 (2,147,483,647). Later, we will see how dates prior to January 1, 0001 need to be adjusted for accurate calculations. For example: June 21, 2001 is stored as 730,657 December 25, 1950 is stored as 712,216 This internal Date type format will be defined for future reference as: Definition: liFixedDate = Internal long integer Date type Calculation: longInt(daAny) where daAny is an OPAL Date type Time OPAL Time variables store times in hour-minute-second-millisecond format. Internally, Time values are stored as long integers representing the number of milliseconds since midnight which is 0. Range of possible values is 0 - 86,359,999 for a total of 86,400,000 milliseconds in each day. For example: 12:00:00 PM (Noon) is stored as 43,200,000 06:00:00 AM is stored as 2,160,000 This internal Time type format will be defined for future reference as: Definition: liFixedTime = Internal long integer Time type Calculation: longInt(tiAny) where tiAny is an OPAL Time type DateTime OPAL DateTime variables store data in the form hour-minute-second-millisecond year-month-day format. Internally, DateTime values are stored as a floating point number representing the number of milliseconds from midnight January 1, 0001. For example: June 1, 2001 at 12:00:00 PM (Noon) = 63,127,080,000,000 This internal DateTime type format will be defined for future reference as: Definition: nuFixedDateTime = Internal Number DateTime type Calculation: number(dtAny) where dtAny is an OPAL DateTime type Next: Adjustments to Dates prior to January 1, 0001 References Common / Shared ObjectPALŽ Routines |
| < Prev | Next > |
|---|





