1. Technical Field
The description and claims herein generally relate to date and time conversion, and more specifically relate to real time universal date and time conversion in a computer system.
2. Background Art
Many different date calendaring systems have been developed over the centuries. These date calendaring systems are typically based on a complex set of observations, algorithms, and conventions, which attempt to define a ‘time’ and ‘date’ according to the sun, moon, stars, or other bodies with respect to the earth and each other. The modern business world has largely accepted the Gregorian calendar (as adopted by ISO 8601 or other national/local conventions). However, even with this “standard,” there are still important differences in each implementation of this calendar in business, financial, and civil applications. These differences create confusion and inaccuracies regarding data produced by or extracted from computer applications and computer systems using these date calendaring systems. In addition there are many other formats in use around the world. Thus many seemingly irreconcilable variations of calendaring systems have been promulgated over time, and many different calendaring systems are in use around the world today.
When developing computer programs, programmers must deal with these different calendar systems to share information between computers, applications and data stored with a different date system. In the past, the majority of programmers have attempted to reconcile the different calendaring systems by manual creation of a fixed translation table for each year and each conversion, with each table representing the specific conversion format desired (for instance, Date of Year for 2006 to ISO 8601 Week of Year for 2006). This involves error-prone manual work in the creation and loading of these conversion tables. Other attempts have used post-processing routines, either done manually or run automatically, to refine the extracted data to convert it to a date in the desired format, after the initial data gathering had been done. These prior attempts at date and time conversion are directed to a specific situation and thus limited to that situation and conversion. These prior methods are impractical for handling any long era or group of timeframes or other multiple calendar systems. Thus, there is currently no known way to reliably convert the date and time to a desired format during the runtime of an application or query, without resorting to fixed published conversion tables or the like. There is furthermore no way to change the date format requested, real-time, to accommodate changing or new date format needs as they arise.
Without a way to efficiently and in real time convert dates between different calendar systems, computer system development will continue to suffer from error prone and inefficient conversion of dates using conversion tables.
The specification and claims herein are directed to making date-time conversions and complex date-time calculations between dates of different calendaring systems. The conversion method herein allows embedded, real-time conversion in computer applications and systems between multiple calendaring systems. The conversion method utilizes extensible algorithms to make the date-time conversions. Using these extensible algorithms, any required date or time variation can be calculated when provided with specific requirements of a date-time format. A date of a first date-time format is converted to any date of a second date-time format after a transformation to a temporal reference or epoch date. The conversion method can be embedded into any code space to enable full date-time conversion abilities. The real-time conversion of the conversion method requires no conversion tables and no post-processing manipulation thus eliminating the need for individual programmers to re-create the same date cross reference tables, or post processing algorithms. The conversion method supports conversion between any two date-time formats including the various existing Gregorian conventions in use in the business world.
The foregoing and other features and advantages will be apparent from the following more particular description, and as illustrated in the accompanying drawings.
The disclosure will be described in conjunction with the appended drawings, where like designations denote like elements, and:
The description and claims herein are directed to a method and apparatus to perform date-time conversions and complex date-time calculations between dates of different calendaring systems. A date-time of a first format is converted to any other date-time of another format after a transformation to a temporal reference or epoch date.
Referring to
Main memory 120 contains data 121, an operating system 122, an application 123 with a date conversion mechanism 124, and a date-time parametric definition 125. Data 121 represents any data that serves as input to or output from any program in computer system 100. Operating system 122 is a multitasking operating system known in the industry as i5/OS; however, those skilled in the art will appreciate that the spirit and scope of this disclosure and claims are not limited to any one operating system.
Computer system 100 utilizes well known virtual addressing mechanisms that allow the programs of computer system 100 to behave as if they only have access to a large, single storage entity instead of access to multiple, smaller storage entities such as main memory 120 and DASD device 155. Therefore, while data 121, operating system 122, application 123, date conversion mechanism 124, and a date-time parametric definition 125 are shown to reside in main memory 120, those skilled in the art will recognize that these items are not necessarily all completely contained in main memory 120 at the same time. It should also be noted that the term “memory” is used herein generically to refer to the entire virtual memory of computer system 100, and may include the virtual memory of other computer systems coupled to computer system 100.
Processor 110 may be constructed from one or more microprocessors and/or integrated circuits. Processor 110 executes program instructions stored in main memory 120. Main memory 120 stores programs and data that processor 110 may access. When computer system 100 starts up, processor 110 initially executes the program instructions that make up operating system 122. Although computer system 100 is shown to contain only a single processor and a single system bus, those skilled in the art will appreciate that the improved transformation engine described herein may be practiced using a computer system that has multiple processors and/or multiple buses.
Display interface 140 is used to directly connect one or more displays 165 to computer system 100. These displays 165, which may be non-intelligent (i.e., dumb) terminals or fully programmable workstations, are used to allow system administrators and users to communicate with computer system 100. Note, however, that while display interface 140 is provided to support communication with one or more displays 165, computer system 100 does not necessarily require a display 165, because all needed interaction with users and other processes may occur via network interface 150.
Network interface 150 is used to connect other computer systems and/or workstations (e.g., 175 in
At this point, it is important to note that while the date conversion mechanism has been and will continue to be described in the context of a fully functional computer system, those skilled in the art will appreciate that the date conversion mechanism described herein is capable of being distributed as an article of manufacture in a variety of forms, and that the claims extend to all types of computer-readable media used to actually carry out the distribution. Examples of suitable computer-readable media include: recordable media such as floppy disks and CD-RW (e.g., 195 of
As used herein, a “date-time” represents a specific date and time expressed in a format for a specific calendar system. The date-time conversion method uses a date-time parametric definition to calculate an offset from epoch date or determine a date from an epoch offset. The date-time parametric definition includes parameters needed to create a conversion for a given calendar system as described below. As used herein, a date in a date-time format is made up of base units and derived units. The base units are periods of fixed lengths of time, and the derived units are constructs of the base units. The derived units may include seasonal-astronomical constructs' which are factors to increase the accuracy of the date-time format relative to observed seasonal or astronomical events. Each base unit is a period of fixed length so it can be treated as a fixed unit of time, with a set function to convert it into an offset, in the smallest common unit of time (usually milliseconds) from an arbitrarily defined ‘Universal Epoch Start Point’. With date-time formats defined in this way, the date conversion mechanism translates a date from any date-time format using a parametric definition to an offset value from the epoch start point. Once converted, any requested mathematical operation can be performed upon the universal values. The universal result can then be translated back to a date in any number of required date-time formats with another parametric definition.
For each date-time format, corresponding to a calendar system, the date conversion mechanism creates or uses an existing date-time parametric definition. Each parametric definition includes the following parameters to define the calendar system:
The date-time conversion method described herein can be embodied in an extensible software routine which may be embedded in any application for real time conversion between date-time formats of different calendaring systems. The method treats calendrical variations and calendrical units as a hierarchy of ‘universal groupings of time’, with added plug-in ‘extensions’ to take care of any cyclical or non-cyclical induced variations. In this way, the method is extensible, such that any calendar or arbitrary calendar variation may be instantiated via the input of new values to create a new date-time parametric definition to describe the new date-time format for a new calendar system.
A method herein provides conversion from a date of a first date-time format to a date of any other date-time format after a transformation to a temporal reference or epoch date. The method inputs a date with a date-time format and a desired output date-time format. If the parametric definitions of both of these date-time formats are available, then the input date is transformed with the parametric definition, any calculations are performed, and then the date is converted to the desired output date-time format with the corresponding parametric definition. If the parametric definitions for date-time of the input date or the desired date are not available, the method inputs from the user the necessary calendar parameters to create the parametric definition for the missing calendar system. An input date is converted into an offset from an arbitrary universal epoch start point, expressed in the same basic unit of time, referenced to the calendar in question. Calculations can be performed upon the offsets and then the results, expressed in Offsets from the epoch start point, is converted to any desired date-time format specified. The conversion is done by reconverting to even increments of definable period or length, stripping the remainder, and applying factors to restore any cyclical or non-cyclical induced variations. This method is described further below with reference to
As mentioned above, the method described herein includes performing calculations upon the results of converting an input date into an offset from a universal epoch start point. For example, such calculations could be adding or subtracting some amount of time to the offset before changing the offset to the desired calendar system. A second example could be to add a difference between two dates to the offset. In this example, two dates would need to be input for conversion to offsets, then the difference between the offsets determined. The difference could then be added or subtracted from a date offset before converting to the desired output calendar system. Thus while the method is described with the simple case of a single input date, in some cases the input may require multiple dates for the step of performing requested calculations.
The methods described above with reference to
We will now consider the formula shown in
We will now consider the formulas shown in
One skilled in the art will appreciate that many variations are possible within the scope of the claims. Thus, while the disclosure has been particularly shown and described above, it will be understood by those skilled in the art that these and other changes in form and details may be made therein without departing from the spirit and scope of the claims.
This is a Non-provisional application of U.S. Patent Provisional Application Ser. No. 60/941,512, filed Jun. 1, 2007, entitled, “Real Time Embedded Universal Date/Time Conversion Algorithms”, the entirety of which is hereby incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
6108640 | Slotznick | Aug 2000 | A |
7349920 | Feinberg et al. | Mar 2008 | B1 |
7702651 | Dickey et al. | Apr 2010 | B1 |
7707496 | Moore et al. | Apr 2010 | B1 |
Number | Date | Country | |
---|---|---|---|
20080301212 A1 | Dec 2008 | US |
Number | Date | Country | |
---|---|---|---|
60941512 | Jun 2007 | US |