CA2238083A1 - System and method for storing and processing date information capable of spanning centuries - Google Patents
System and method for storing and processing date information capable of spanning centuries Download PDFInfo
- Publication number
- CA2238083A1 CA2238083A1 CA002238083A CA2238083A CA2238083A1 CA 2238083 A1 CA2238083 A1 CA 2238083A1 CA 002238083 A CA002238083 A CA 002238083A CA 2238083 A CA2238083 A CA 2238083A CA 2238083 A1 CA2238083 A1 CA 2238083A1
- Authority
- CA
- Canada
- Prior art keywords
- year
- information
- digit
- determining
- date
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Abandoned
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/04—Generating or distributing clock signals or signals derived directly therefrom
- G06F1/14—Time supervision arrangements, e.g. real time clock
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Complex Calculations (AREA)
Abstract
A system for reading and writing overloaded dates is provided in which six digits are used to represent dates including century information in a manner which maintains sorting and indexing. A three digit prefix is determined from the year and century information using windowing if necessary, and a three digit suffix is determined from the day and month information. Furthermore, a system for reading and writing overloaded Julian dates is provided in which five digits are used to represent dates including century information in a manner which maintains sorting and indexing. An offset value is created by multiplying the maximum number of days in any year (plus 1), being 367, by the number of the year in the Julian date then adding the day portion. The year is windowed to derive a century that if true requires a value greater than 99 x 367 (36333) be added to the offset value to indicate a subsequent century. The process is revised to interpret such a date.
Description
System and Method for Storing and Processing Date Information Capable of Spanning Centuries Field of the Invention The invention relates to systems and methods for storing and processing date information capable of spanning centuries.
Background of the Invention The "year 2000 problem" is now a well known phenomenon which has resulted from the fact that most existing application software particularly in the business data processing area stores and processes date information in a six-digit format which does not include any century information. The date might for example be stored using the Gregorian day/month/year within century format in which case the date January 21, 1999 would be stored as 210199. Year information in "year within century" format is a two-digit year which does not include the century. Year information which include the century will be referred to as "complete year information" or as year information in "complete format", for example "1999".
Until recently, it was an acceptable assumption to make that any and all years stored belonged to the 20th century and as such there was no ambiguity in such dates.
However, now it is necessary to be capable of processing dates for years belonging to the 21st century. This presents a problem both for storing and processing the date information.
It would be desirable to be able to include century information without changing storage requirements as this would require substantive changes to software accessing the date information. For processing, conventional applications 2 _ can sort date information within a given century but cannot sort dates from different centuries. Consider for example that a date having the year 2005 would have a year within century field equal to 05, and a date having the year 1995 would have a year within century field equal to 95 which would be incorrectly interpreted as being after the stored version of the date 2005. Furthermore, files containing date information are often indexed by that date information. It should be possible to use the date information to uniquely index stored information and clearly this is not possible when the century is ambiguous.
Various solutions have been proposed. U.S. patent Number 5,600,836 to Alter entitled "System and Method for Processing Date-Dependent Information which Spans One or Two Centuries" which issued an February 4, 1997 involves using "zone data files" which contain dates which have been converted to "zone times" and "local data files" which contain the dates in the conventional format. This requires significant calculation and logic to encode and decode the date information.
U.S. Patent Number 5,644,762 to Soeder entitled "System and method for Processing Date-Dependent Information which Spans One or Two Centuries" which issued on July 1, 1997 discloses a solution for storing the century in a six digit date by adding the century and converting the century and year combination to a binary value. While this will work for some applications, it has the disadvantages of requiring a mixed mode storage strategy. The issue of storage is important because some computer programs would not be able to alter their strategy and others may suffer side-effects from such a change. A storage strategy is the way in which the computer physically represents the data based on the type of data it is. For example, a letter such as the letter "A" can be stored in one byte or 8 bits. A bit is the elemental storage unit of computers. However, a two-digit number such as 99 can also be stored in as few as 8 bits. In fact the numbers from 0 to 255 can be stored in 8 bits. One can see that any change to the storage strategy may effect the way in which a program was originally designed. Thus, it is desirable to maintain whatever storage strategy exists when devising new ways to represent date information.
U.S. Patent Number 5,668,989 to Mao entitled "Two-Digit Hybrid Radix Year Numbers for Year 2000 and Beyond"
which issued September 16, 1997 treats the higher digit of a two digit year number as hexadecimal but displayed in a decimal-like format with font patterns such as 0 - 9 and '0 -'5 so that the year 1900 is represented and processed as 00 while the year 2000 is represented and processed as '00. This will only handle dates up to 2059.
Finally, other methods include full expansion which requires 33~ more storage space, windowing, the "Roman Format", packed format, and extended Julian.
The "year 2000 problem" also applies to dates in the Julian form. Julian dates by definition include only a two digit year within century and a day number of the year. It is a five-digit number formulated such that the first two digits represent the year within century and the last three digits represent the day within the year. For example, the Julian date 75123 represents the 123rd day of 1975.
Since this form does not permit the century to be represented, conventional programming logic would assume that 02001 would be January 1, 1902 rather than January 1, 2002.
Because of the impending century change, this issue has become a problem for programs that use Julian date formats. Julian formats are used extensively in computer programs to enforce the fact that years are more significant in sorting sequence that days and because there is less storage space required to record a five digit date than a six digit one.
Of several solutions proposed, only one retains the ability to keep the date as five digits thus eliminating the need to expand date fields. This method requires that the date use a different storage strategy. The year portion of the date is represented as a packed number such that the number 75 would occupy one byte rather than two and the century digits are stored as 1 byte in the vacated place of the decade number. Unfortunately, in some applications the Julian date is already stored as a packed number and in these cases this plan would offer no benefit.
A variation of this scheme would see the day portion being stored in a different manner to free up computer storage bytes. This is again unsatisfactory as it also requires changing the storage strategy.
Other methods involve adding digits such as 1975 001 to represent January 1, 1.975 or 175 001 to represent January 1, 2000. Obviously, these are forms of date expansions that do not maintain a five digit date. Similarly, switching to a Gregorian Date such as O1 O1 75 does not permit a century indicator, and this would require a seven or eight digit format such as O1 O1 1975 for January 1, 1975. This again is an unsatisfactory solutian.
Summary of the Invention It is an object: of the invention to obviate or mitigate one or more of t:he above identified disadvantages.
According to a first broad aspect, the invention provides a series of operational steps to be performed on or with the aid of a computer, said steps comprising:
a) whenever necessary, determining a six digit overloaded date from day, month and year information by performing the steps of:
al) determining a three digit prefix from the year information which maintains sort order;
a2) determining a three digit suffix from the day and month information which maintains sort order; and a3) determining a six digit overloaded date by combining the three digit prefix and the three digit suffix.
According to a second broad aspect, the invention provides a series of operational steps to be performed on or with the aid of a computer, said steps comprising:
b) whenever necessary determining day, month and year information from a six digit overloaded date by performing the steps of bl) determining a three digit prefix and a three digit suffix from the six digit overloaded date;
b2) determining the year information from the three digit prefix; and b3) determining the day and month information from the three digit suffix.
According to a third broad aspect, a method is provided including the steps of the first and second broad aspects described above. Preferably in such an aspect, step al) comprises the steps af:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and. if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information;
step bl) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
step b2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information;
and step b3) camprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
Advantageously, the method allows the overloaded date to be stored in six numeric decimal digits. The overloaded date maintains sort sequence. The processing overhead introduces is not unreasonable.
Preferably, the six numeric digits computed for a given overloaded date can be stored in three bytes.
Preferably, the date is mathematically calculated.
Preferably, the century is determined using windowing, windowing being a process of inferring the century based on. the year portion of a date such that a year less than a given number is deemed to be in the latter century.
According to a fourth broad aspect, the present invention provides an apparatus comprising a computer programmed to perform a series of operational steps for storing an overloaded date from a first date component constrained to be an integer in the range 0 .. N1, where Nl is an integer, and a secand date component constrained to be an integer in the range 0 .. N2, where N2 is an integer, the series of steps comprising:
a) multiplying the second value or the second value minus a predetermined offset by a second value multiplier K which is an integer greater than N1;
b) adding the' result of step a) to the first value to get the overloaded date;
c) storing the overloaded date in memory.
According to a fifth asepct, the present invention provides an apparatus comprising a computer programmed to perform a series of operational steps for reading a date having a first date component constrained to be an integer in the range O..N1, where N7. is an integer, and a second date component constrained to be an integer in the range O..N2, where N2 is an integer, from an overloaded date, the series of steps comprising:
a) reading the overloaded date from memory;
b) dividing the overloaded date by a second value multiplier K which is an integer greater than N1 to get the second value;
c) subtracting the second value times the second value multiplier from the overloaded date to get the first value.
According to a sixth broad aspect, the present invention provides a series of operational steps to be ._ g _ performed on or with the aid of a computer, said steps comprising whenever necessary, determining a five digit overloaded date from day and year information by performing the steps of multiplying the year information by a year multiplier which is greater than 366 and adding the day information.
According to a seventh broad aspect, the invention provides a series of operational steps to be performed on or with the aid of a computer, said steps comprising whenever necessary determining day and year information from a five digit overloaded date by performing the steps of:
dividing the overloaded date by a predetermined year multiplier which is greater than 366 to get year information;
and subtracting the' years information times the year multiplier from the overloaded date to get the day information.
Brief Description of the Drawings Preferred embodiments of the invention will now be described with reference to the attached drawings in which:
Figure 1 is a flowchart for a method of determining an overloaded date according to an embodiment of the invention;
Figures 2A - 2C' are flowcharts for the step of determining the year prefix appearing in Figure 1;
Figures 3A and 3B are flowcharts for methods of determining a six or eight digit date representation respectively from an overloaded date determined with the method of Figure 1;
Figure 4 is a block diagram of a computing device according to an embodiment of the invention;
Figure 5 is a flowchart for a method of encoding a five digit overloaded date from a Julian date according to an embodiment of the invention; and Figure 6 is a flowchart for a method of determining a Julian. date from a five'-digit overloaded date.
Detailed. Description of t:he Preferred Embodiments Referring now t:o Figure 1 a method of determining an overloaded date according to an embodiment of the invention has as its input a date which includes day, month and year within century information and may or may not also include century information. The' method will be described in detail with respect to the example date of 25 November 2012 for the case where century information is included, or 25 November '12 for the case where century information is not included.
In the first step 202 the number of complete previous months that year is determined by subtracting one from the numeric representation of the month. In this example, the number is 11. (numeric representation of November) minus 1 equals 10. In tree second step 204, the results of the previous step 202 are multiplied by 31 and added to the day field of the date to give' a suffix quantity. In this example, this yields 10 x 31 + 25 = 335 as the suffix. In step 206 a three digit "century and year" prefix is determined according to one of the methods described in detail below. For the purposes of this example, assume that the century and year prefix is 112. In step 208 the overloaded date is determined by multiplying the century and year prefix (output of step 206A) by 1000 and adding the suffix (output of step 204). In our example, this yields 1000 x 112. + 335 = 112335 as the overloaded date.
Various methods may be used to determine the century and year prefix, the important factor being that it may be stored in three digits (i..e. prefix less than or equal to 999) and maintains sorting anc~ indexing of centuries and years.
The methods used may depend upon the format of the data being input to the method and more particularly whether it includes century information. First of all, a "base year"
must be selected, this preferably being a century year. The method will be incapable of representing dates prior to the base year. For most applications currently contemplated the base year would be 1900.
For input data which does not include century information an assumption about the century must be made. For the 1900 base year example, the year 2012 would have a two digit year field of 12 in input data which does not include century information. For this case, an assumption may be made that all two digit years equal to or greater than a certain year which will be refereed to herein as the "pivot year"
belong to the century beginning with the base year and that all year's less than the pivot year belong to the century following the base year. The flowchart of Figure 2A will be used to describe the processing of such input information and this will be referred to as "method A". In step 232 the year field is compared with tree pivot year. If the year input is less than the pivot year then step 234 is executed, this consisting of determining the century and year prefix to be the year' input + 100. If: the year input is not less than the pivot year then step 236 is executed, this consisting of determining the century and year prefix to be the year input.
For data for which no assumption regarding century needs to be made, i.e. the input data includes complete year information, the century and year prefix may be determined simply by subtracting the base year from the complete year information. For example, if the year is 2012, then the century and year prefix i.s determined from 2012 - 1900 = 112.
This is depicted in flowchart form in Figure 2B and will be referred to as "method B".
For data which is mixed in the sense that it may or may not include century information, either method A or method B may be executed. This is depicted in Figure 2C wherein a test (step 240) is used t:o determine which method to use, method A. or method B. If: the year is greater than 99 then century information must be present: and method B can be used.
Otherwise method A is used. In either case, the first digit of the prefix is an indicator of the century of the year with respect to the base year and will be referred to as the century index. For years within 100 years of the base year, the century index is "0", for years within between 100 and 200 years of the base year, t:he century index is "1" and so on.
The date information may then be stored in any conventional fashion, and more part:icularly can be stored in as little as three bytes using conventional storage techniques.
In order to present either a six digit or an eight digit date in conventional format from the overloaded date requires the above proceess to be reversed. A method for obtaining the date in sip: digit format (two digit year) will be described with reference to the flowchart in Figure 3A in the context of the above developed overloaded date of 112335.
The first step 302 is to divide the overloaded date by 100000 and to take the integer part thereby yielding the century index. For the example this yields a century indicator of "1". The next step 304 i.s to divide the overloaded date by 1000 and to take the integer part t:o produce the century and year prefix. For the e~!:ample this yields a century and year prefix of 112. In the next step 306A to get the two digit year, 100 times the century index is subtracted from the century and year prefix determined in step 304. In the example this yields 112 -~ 100 x 1 =- 12. In step 308, to get the suffix, 1000 times the prefix is subtracted from the overloaded date. In our example, this yields a suffix of 335.
In step 310, the month i~~ retrieved by carrying out steps 312, 314 and 316. Step 312 consists of subtracting one from the suffix computed in step ..08 to prevent incorrectly determining the subsequent month when dividing by 31 if the day is the 31st. Step 314 comprise~~ dividing the result by 31 to get the number of prior months. In our example, this yields 10 as the number of prior months. Finally step 316 comprises adding one to the result of step 319: to get the actual month. In our example, the month is determined to be 11. In step 318, the day information is determined by subtracting the number of previous months times 31 from the suffix. In our example, the day is determined to be 25.
When an eight digit date is to be produced (four digit year) the century and year prefix is determined by dividing the overloaded date by 1000. The year is determined by adding the base year t:o the prefix. The remaining steps are the same as for the ~>ix digit format. This is shown in Figure 3B which is the same as Figure 3A with the exception that step 306B is executed in place of step 306A and step 302 is not required.
Figure 4 shows a computing device for implementing the invention. Computing device 348 includes storage 360 for storing dates, these normally forming part of some larger records. Read/write device 358 reads from and writes to the storage under control of a processor such as microprocessor 350. The microprocessor 350 has logic circuitry for executing the methods of Figures 1-~3 described above, or may be a computing device appropriately programmed to execute the methods. The device may include any or all of input 352, printer 354, or display ..56 as needed, for example. The storage 360 may be a permanent storage medium such as a disk or tape in which case the' read/write device 358 provides access to this permanent storage medium. Alternatively, storage 360 may be any type of volatile storage such as RAM or microprocessor registers for example in which case the functionality of the read/write device 358 may be part of the functionality of the microprocessor.
In the above described examples, the suffix is determined by subtracting one from the current month, multiplying by 31, and adding the day. More generally, any technique of sortably representing the day and month in three digits may be used. For example, t:he month may be multiplied by any "month multiplier"' between 31 and 80 inclusive may be used to create a number which when added to the day will yield a number less than 1000, the requirement for three digit storage. Furthermore, if: a number greater than 31 is used, then steps 204,312, and ~~16 described previously are not required.. For example, i.f 32 is used, then for our November 25, 2012 date the suffix would simply be 11*32+15=377. The month would be recoverable from the suffix by dividing the suffix by the month multiplier (in our example 377/32 - 11) and the day would be recoverable by subtracting the month times th.e month multiplier from the suffix (in our example 377 - 11*32 - 25).
In the above e~:amples, the prefix and suffix are determined using numerical methods) and require no string manipulations. This is desirable because string manipulations are slow to perform. However, in the case that string manipulations are permissible, even though there is no apparent advantage to doing so, the three digits of the suffix and the three digits of t:he prefix may be arranged in any predetermined order since the suffix and prefix would still be recoverable. In addition, different methods of generating the prefix and suffix may be used which are self-evident from the above described numerical. methods.
Should input dates be available in the Julian format yy/ddd where ddd is from 1-366, the suffix may simply be selected. to equal the ddd field if it is understood that all dates will be in that format since this satisfies the requirerr~ent that the suffix be sortable and contain values less than 999. This however requires six digits to store the overloaded date where the' input only contained five digits.
In the above described Gregorian date overloading methods, a two digit day and a three digit month were compressed into a three digit suffix by taking advantage of the fact that a three digit suffix can hold numbers up to 999, and after allocating a capacity for a day value up to 31, the remaining capacity, namely 968 can be used to uniquely store the month as a multiple of a second number greater than 31.
For example, if the multiple chosen is 32, then a second number i.n the range of 0 to 968/32=30 can be represented in addition to the day value.
Where in the Gregorian example, this technique was used to store day and month information in a single suffix, this same technique can be used in representing the Julian day and year in a single field. In this case, a five digit field can hold numbers up to 99999. After allocating 366 for day values up to 366, there is a remaining capacity, namely 99999-366=99633 which is available for the year and century information. A second number may be stored as a multiple of some number greater than 366, for example 367. In this case, the second number can be between 0 and 99633/367 = 271. By selecting a base year of 1900 for example, any year from 1900 through to 1900 + 271 = 2171 may be represented in this manner.
A method of generating and decoding a five digit overloaded date from a five digit Julian date will now be described with reference to Figures 5 and 6. A base year must first be selected, and the method will be incapable of representing years prior to the base year. For the purposes of example, we will assume the base year is 1900. In step 500, an initial value foz- the five digit overloaded date is simply determined as the day information plus the year in century multiplied by a predetermined year multiplier which is greater than or equal to 367.
Next, the year in century value is compared to a pivot year value (step 502). If it is greater than the pivot year value, then an assumption is made that the year belongs to the century of the ba~~e year. In this case, the value computed thus far is the overloaded date. If it is less than the pivot year value, then an assumption is made that the year belongs to the century following the century of the base year.
In this case, a century offset equal to 100 times the year multiplier is added to the value computed thus far (step 504).
Alternatively, a century offset greater than 100 times the year multiplier may be added to the value computed thus far.
Two examples will be first given where the century offset is chosen to equa7_ 100 times the year multiplier.
Consider' for example the five digit Julian date 98032 which represents February 1, 1998, in a system using a pivot year of 30, and having a base year of 1900, a year multiplier of 367, and a century offset of 1.00 x year multiplier = 36700. In this case, the above described method results in a five digit overloaded date of 98 * 367 + 32 - 35998. For the five digit Julian date 25032, which represents February 1, 2025, the same parameters would result i.n a five digit overloaded date of 25 * 367 + 32 + 36700= 45907. If a four digit year (complete year information) is available, then the complete year minus the base year is multiplied by the year multiplier and added to the day information.
The same two e~!:amples will be next given where the century offset is chosen to be greater than 100 times the year multiplier. Consider for example the five digit Julian date 98032 which represents February 1, 1998, in a system using a pivot year of 30, and having a base year of 1900, a year multiplier of 367, and a century offset of 40000. In this case, the above described method results in a five digit overloaded date of 98 * ?.67 + 32 - 35998. For the five digit Julian date 25032, which represents February 1, 2025, the same parameters would result i.n a five digit overloaded date of 25 * 367 + 32 + 40000 = 49207.
Referring now t:o Figure 6, the decoding of a five digit overloaded date will be described. Of course, the particular steps taken tc> decode will depend upon the particular encoding step~~ used.
If a century offset other than 100 times the year multiplier is used, then if the five digit overloaded date is greater than the century offset (step 600), a starting point is selected which is the century fallowing the base year (step 602), and the century offset is subtracted from the five digit overloaded date (step 609:). Alternatively, if the five digit overloaded date is less than the century offset, then the starting point is set to the base year (step 606). The year in century is determined from the remaining overloaded date divided by the century multiplier (step 608). The days value is determined according t:o the remaining overloaded date minus the year in century times the year multiplier (step 610).
Finally, the five digit Julian date is determined according to year in century times 1000 plus days (step 612). If a four digit year is required, t:he year in century plus the starting point is used.
If a century offset equal to 100 times the year multiplier is used, then the same approach may be used to decode the Julian date. Alternatively, a years from base year value may be determined according to the five digit overloaded date divided by the year multiplier. The days value is determined according to t:he overloaded date minus the years from base year times the year multiplier. Finally, a seven digit Julian date is determined according to (years from base year plus the base year ) times 1000 plus days. If a two digit year is required, t:he first two digits can be stripped off in various ways. For example, a two digit year in century can be computed according to:
year in century = years from base year minus (years from base year/100) * 100.
In this case, a five digit Julian date is determined according to year in century times 1000 plus days.
By way of example, consider the first above example overloaded Julian date of: 35998, in the case where the century offset is 100 times the year multiplier, i.e. 36700. The year is determined according t:o 35998/367 = 98. The day is determined according to 35998 - 98*367=32. The Julian date is determined according to 98*1000+32=98032.
In the second above example, the overloaded Julian date was 45907 and the century offset was again 36700. In this case, 45907 is greater than 36700, so the starting paint is determined as the year 2000. The year in century is determined according to 1:45907 - 36700) /367 = 25. The days are determined according to (45907--36700) - 25*367 = 32. The five digit Julian date i~~ then 1000*25 + 32 = 25032.
Alternatively, for the second example, 45907 can be divided by the year multiplier to yield 125 as the years from base year.
In the third e~:ample, the overloaded Julian date was 35998 anal the century offset was 40000. The year is determined according to ..5998/367 = 98. The day is determined according to 35998 - 98*:~67=32. The Julian date is determined according to 98*1000+32=98032.
In the fourth example, the overloaded date was 49207 and the century offset was 40000. In this case, 49207 is greater than 40000, so the starting point is determined as the year 2000. The year in century is determined according to (49207 - 40000) /367 = 25. The days are determined according to (49207-40000) - 25*367 = 32. The five digit Julian date is then 1000*25 + 32 = 25032.
Any of the above described methods may be used to convert an entire array of dates to overloaded dates.
Alternatively, the methods may be used one at a time each time a date is accessed.
It is to be understood that any processing means capable of executing the above described methods could be used to implement the invention including computers, microprocessors, ASICs (application specific integrated circuits), FPGAs (field programmable gate arrays) etc.
The above conversion of a date to an overloaded date methods can be described in an even more generalized fashion as a series of operational steps to be performed on or with the aid of a computer for storing an overloaded date from a first date component con~~trained to be an integer in the range 1 .. N1, where N1 is an integer, and a second date component constrained to be an integer in the range 1 .. N2, where N2 is an integer, comprising the steps of:
a) multiplying the second value or the second value minus a predetermined offset by a second value multiplier K which is an integer greater than N1;
b) adding thE: result of step a) to the first value to get the overloaded date;
c) storing the overloaded date in memory.
Similarly, the above conversion of an overloaded date to a normal date methods can be described in an even more generalized fashion as a series of operational steps to be performed on or with the aid of a computer for reading a date having a. first date component constrained to be an integer in the range O..N1, where N7_ is an integer, and a second date component constrained to be an integer in the range O..N2, where N2 is an integer, from an overloaded date, comprising the steps of:
a) reading the overloaded date from memory;
b) dividing t:he overloaded date by a second value multiplier K which is an integer greater than N1 to get the second value;
c) subtracting the second value times the second value multiplier from the' overloaded date to get the first value.
For the Gregorian date overloading embodiment, the first and second date components are day and month values respectively. The day values are constrained to be in the range of one to thirty-one (N1 = 31), and the month values are constrained to be in the range of one to twelve (N2=12). The second value multiplier K in this case is a month multiplier which is greater than N1=:31, and preferably equal to 32.
For the Julian date overloading embodiment, the first and second date components are day and year values respectively. The day values are constrained to be in the range of one to 366 (N1 =. 366), and the year values are constrained to be in a range which is dependent upon the selection of the second value multiplier K, with the range increasing in size with ~omaller K. The second value multiplier in this case i.s a year multiplier which is greater than N1=366, and preferably equal t:o 367.
It is to be noted that in all of the above described embodiments, division is integer division meaning that only the output of any division step is only the integer part of the quotient.
Numerous modifications arid variations of the present invention are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims, the invention may be practised otherwise than as specifically described herein.
Background of the Invention The "year 2000 problem" is now a well known phenomenon which has resulted from the fact that most existing application software particularly in the business data processing area stores and processes date information in a six-digit format which does not include any century information. The date might for example be stored using the Gregorian day/month/year within century format in which case the date January 21, 1999 would be stored as 210199. Year information in "year within century" format is a two-digit year which does not include the century. Year information which include the century will be referred to as "complete year information" or as year information in "complete format", for example "1999".
Until recently, it was an acceptable assumption to make that any and all years stored belonged to the 20th century and as such there was no ambiguity in such dates.
However, now it is necessary to be capable of processing dates for years belonging to the 21st century. This presents a problem both for storing and processing the date information.
It would be desirable to be able to include century information without changing storage requirements as this would require substantive changes to software accessing the date information. For processing, conventional applications 2 _ can sort date information within a given century but cannot sort dates from different centuries. Consider for example that a date having the year 2005 would have a year within century field equal to 05, and a date having the year 1995 would have a year within century field equal to 95 which would be incorrectly interpreted as being after the stored version of the date 2005. Furthermore, files containing date information are often indexed by that date information. It should be possible to use the date information to uniquely index stored information and clearly this is not possible when the century is ambiguous.
Various solutions have been proposed. U.S. patent Number 5,600,836 to Alter entitled "System and Method for Processing Date-Dependent Information which Spans One or Two Centuries" which issued an February 4, 1997 involves using "zone data files" which contain dates which have been converted to "zone times" and "local data files" which contain the dates in the conventional format. This requires significant calculation and logic to encode and decode the date information.
U.S. Patent Number 5,644,762 to Soeder entitled "System and method for Processing Date-Dependent Information which Spans One or Two Centuries" which issued on July 1, 1997 discloses a solution for storing the century in a six digit date by adding the century and converting the century and year combination to a binary value. While this will work for some applications, it has the disadvantages of requiring a mixed mode storage strategy. The issue of storage is important because some computer programs would not be able to alter their strategy and others may suffer side-effects from such a change. A storage strategy is the way in which the computer physically represents the data based on the type of data it is. For example, a letter such as the letter "A" can be stored in one byte or 8 bits. A bit is the elemental storage unit of computers. However, a two-digit number such as 99 can also be stored in as few as 8 bits. In fact the numbers from 0 to 255 can be stored in 8 bits. One can see that any change to the storage strategy may effect the way in which a program was originally designed. Thus, it is desirable to maintain whatever storage strategy exists when devising new ways to represent date information.
U.S. Patent Number 5,668,989 to Mao entitled "Two-Digit Hybrid Radix Year Numbers for Year 2000 and Beyond"
which issued September 16, 1997 treats the higher digit of a two digit year number as hexadecimal but displayed in a decimal-like format with font patterns such as 0 - 9 and '0 -'5 so that the year 1900 is represented and processed as 00 while the year 2000 is represented and processed as '00. This will only handle dates up to 2059.
Finally, other methods include full expansion which requires 33~ more storage space, windowing, the "Roman Format", packed format, and extended Julian.
The "year 2000 problem" also applies to dates in the Julian form. Julian dates by definition include only a two digit year within century and a day number of the year. It is a five-digit number formulated such that the first two digits represent the year within century and the last three digits represent the day within the year. For example, the Julian date 75123 represents the 123rd day of 1975.
Since this form does not permit the century to be represented, conventional programming logic would assume that 02001 would be January 1, 1902 rather than January 1, 2002.
Because of the impending century change, this issue has become a problem for programs that use Julian date formats. Julian formats are used extensively in computer programs to enforce the fact that years are more significant in sorting sequence that days and because there is less storage space required to record a five digit date than a six digit one.
Of several solutions proposed, only one retains the ability to keep the date as five digits thus eliminating the need to expand date fields. This method requires that the date use a different storage strategy. The year portion of the date is represented as a packed number such that the number 75 would occupy one byte rather than two and the century digits are stored as 1 byte in the vacated place of the decade number. Unfortunately, in some applications the Julian date is already stored as a packed number and in these cases this plan would offer no benefit.
A variation of this scheme would see the day portion being stored in a different manner to free up computer storage bytes. This is again unsatisfactory as it also requires changing the storage strategy.
Other methods involve adding digits such as 1975 001 to represent January 1, 1.975 or 175 001 to represent January 1, 2000. Obviously, these are forms of date expansions that do not maintain a five digit date. Similarly, switching to a Gregorian Date such as O1 O1 75 does not permit a century indicator, and this would require a seven or eight digit format such as O1 O1 1975 for January 1, 1975. This again is an unsatisfactory solutian.
Summary of the Invention It is an object: of the invention to obviate or mitigate one or more of t:he above identified disadvantages.
According to a first broad aspect, the invention provides a series of operational steps to be performed on or with the aid of a computer, said steps comprising:
a) whenever necessary, determining a six digit overloaded date from day, month and year information by performing the steps of:
al) determining a three digit prefix from the year information which maintains sort order;
a2) determining a three digit suffix from the day and month information which maintains sort order; and a3) determining a six digit overloaded date by combining the three digit prefix and the three digit suffix.
According to a second broad aspect, the invention provides a series of operational steps to be performed on or with the aid of a computer, said steps comprising:
b) whenever necessary determining day, month and year information from a six digit overloaded date by performing the steps of bl) determining a three digit prefix and a three digit suffix from the six digit overloaded date;
b2) determining the year information from the three digit prefix; and b3) determining the day and month information from the three digit suffix.
According to a third broad aspect, a method is provided including the steps of the first and second broad aspects described above. Preferably in such an aspect, step al) comprises the steps af:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and. if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information;
step bl) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
step b2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information;
and step b3) camprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
Advantageously, the method allows the overloaded date to be stored in six numeric decimal digits. The overloaded date maintains sort sequence. The processing overhead introduces is not unreasonable.
Preferably, the six numeric digits computed for a given overloaded date can be stored in three bytes.
Preferably, the date is mathematically calculated.
Preferably, the century is determined using windowing, windowing being a process of inferring the century based on. the year portion of a date such that a year less than a given number is deemed to be in the latter century.
According to a fourth broad aspect, the present invention provides an apparatus comprising a computer programmed to perform a series of operational steps for storing an overloaded date from a first date component constrained to be an integer in the range 0 .. N1, where Nl is an integer, and a secand date component constrained to be an integer in the range 0 .. N2, where N2 is an integer, the series of steps comprising:
a) multiplying the second value or the second value minus a predetermined offset by a second value multiplier K which is an integer greater than N1;
b) adding the' result of step a) to the first value to get the overloaded date;
c) storing the overloaded date in memory.
According to a fifth asepct, the present invention provides an apparatus comprising a computer programmed to perform a series of operational steps for reading a date having a first date component constrained to be an integer in the range O..N1, where N7. is an integer, and a second date component constrained to be an integer in the range O..N2, where N2 is an integer, from an overloaded date, the series of steps comprising:
a) reading the overloaded date from memory;
b) dividing the overloaded date by a second value multiplier K which is an integer greater than N1 to get the second value;
c) subtracting the second value times the second value multiplier from the overloaded date to get the first value.
According to a sixth broad aspect, the present invention provides a series of operational steps to be ._ g _ performed on or with the aid of a computer, said steps comprising whenever necessary, determining a five digit overloaded date from day and year information by performing the steps of multiplying the year information by a year multiplier which is greater than 366 and adding the day information.
According to a seventh broad aspect, the invention provides a series of operational steps to be performed on or with the aid of a computer, said steps comprising whenever necessary determining day and year information from a five digit overloaded date by performing the steps of:
dividing the overloaded date by a predetermined year multiplier which is greater than 366 to get year information;
and subtracting the' years information times the year multiplier from the overloaded date to get the day information.
Brief Description of the Drawings Preferred embodiments of the invention will now be described with reference to the attached drawings in which:
Figure 1 is a flowchart for a method of determining an overloaded date according to an embodiment of the invention;
Figures 2A - 2C' are flowcharts for the step of determining the year prefix appearing in Figure 1;
Figures 3A and 3B are flowcharts for methods of determining a six or eight digit date representation respectively from an overloaded date determined with the method of Figure 1;
Figure 4 is a block diagram of a computing device according to an embodiment of the invention;
Figure 5 is a flowchart for a method of encoding a five digit overloaded date from a Julian date according to an embodiment of the invention; and Figure 6 is a flowchart for a method of determining a Julian. date from a five'-digit overloaded date.
Detailed. Description of t:he Preferred Embodiments Referring now t:o Figure 1 a method of determining an overloaded date according to an embodiment of the invention has as its input a date which includes day, month and year within century information and may or may not also include century information. The' method will be described in detail with respect to the example date of 25 November 2012 for the case where century information is included, or 25 November '12 for the case where century information is not included.
In the first step 202 the number of complete previous months that year is determined by subtracting one from the numeric representation of the month. In this example, the number is 11. (numeric representation of November) minus 1 equals 10. In tree second step 204, the results of the previous step 202 are multiplied by 31 and added to the day field of the date to give' a suffix quantity. In this example, this yields 10 x 31 + 25 = 335 as the suffix. In step 206 a three digit "century and year" prefix is determined according to one of the methods described in detail below. For the purposes of this example, assume that the century and year prefix is 112. In step 208 the overloaded date is determined by multiplying the century and year prefix (output of step 206A) by 1000 and adding the suffix (output of step 204). In our example, this yields 1000 x 112. + 335 = 112335 as the overloaded date.
Various methods may be used to determine the century and year prefix, the important factor being that it may be stored in three digits (i..e. prefix less than or equal to 999) and maintains sorting anc~ indexing of centuries and years.
The methods used may depend upon the format of the data being input to the method and more particularly whether it includes century information. First of all, a "base year"
must be selected, this preferably being a century year. The method will be incapable of representing dates prior to the base year. For most applications currently contemplated the base year would be 1900.
For input data which does not include century information an assumption about the century must be made. For the 1900 base year example, the year 2012 would have a two digit year field of 12 in input data which does not include century information. For this case, an assumption may be made that all two digit years equal to or greater than a certain year which will be refereed to herein as the "pivot year"
belong to the century beginning with the base year and that all year's less than the pivot year belong to the century following the base year. The flowchart of Figure 2A will be used to describe the processing of such input information and this will be referred to as "method A". In step 232 the year field is compared with tree pivot year. If the year input is less than the pivot year then step 234 is executed, this consisting of determining the century and year prefix to be the year' input + 100. If: the year input is not less than the pivot year then step 236 is executed, this consisting of determining the century and year prefix to be the year input.
For data for which no assumption regarding century needs to be made, i.e. the input data includes complete year information, the century and year prefix may be determined simply by subtracting the base year from the complete year information. For example, if the year is 2012, then the century and year prefix i.s determined from 2012 - 1900 = 112.
This is depicted in flowchart form in Figure 2B and will be referred to as "method B".
For data which is mixed in the sense that it may or may not include century information, either method A or method B may be executed. This is depicted in Figure 2C wherein a test (step 240) is used t:o determine which method to use, method A. or method B. If: the year is greater than 99 then century information must be present: and method B can be used.
Otherwise method A is used. In either case, the first digit of the prefix is an indicator of the century of the year with respect to the base year and will be referred to as the century index. For years within 100 years of the base year, the century index is "0", for years within between 100 and 200 years of the base year, t:he century index is "1" and so on.
The date information may then be stored in any conventional fashion, and more part:icularly can be stored in as little as three bytes using conventional storage techniques.
In order to present either a six digit or an eight digit date in conventional format from the overloaded date requires the above proceess to be reversed. A method for obtaining the date in sip: digit format (two digit year) will be described with reference to the flowchart in Figure 3A in the context of the above developed overloaded date of 112335.
The first step 302 is to divide the overloaded date by 100000 and to take the integer part thereby yielding the century index. For the example this yields a century indicator of "1". The next step 304 i.s to divide the overloaded date by 1000 and to take the integer part t:o produce the century and year prefix. For the e~!:ample this yields a century and year prefix of 112. In the next step 306A to get the two digit year, 100 times the century index is subtracted from the century and year prefix determined in step 304. In the example this yields 112 -~ 100 x 1 =- 12. In step 308, to get the suffix, 1000 times the prefix is subtracted from the overloaded date. In our example, this yields a suffix of 335.
In step 310, the month i~~ retrieved by carrying out steps 312, 314 and 316. Step 312 consists of subtracting one from the suffix computed in step ..08 to prevent incorrectly determining the subsequent month when dividing by 31 if the day is the 31st. Step 314 comprise~~ dividing the result by 31 to get the number of prior months. In our example, this yields 10 as the number of prior months. Finally step 316 comprises adding one to the result of step 319: to get the actual month. In our example, the month is determined to be 11. In step 318, the day information is determined by subtracting the number of previous months times 31 from the suffix. In our example, the day is determined to be 25.
When an eight digit date is to be produced (four digit year) the century and year prefix is determined by dividing the overloaded date by 1000. The year is determined by adding the base year t:o the prefix. The remaining steps are the same as for the ~>ix digit format. This is shown in Figure 3B which is the same as Figure 3A with the exception that step 306B is executed in place of step 306A and step 302 is not required.
Figure 4 shows a computing device for implementing the invention. Computing device 348 includes storage 360 for storing dates, these normally forming part of some larger records. Read/write device 358 reads from and writes to the storage under control of a processor such as microprocessor 350. The microprocessor 350 has logic circuitry for executing the methods of Figures 1-~3 described above, or may be a computing device appropriately programmed to execute the methods. The device may include any or all of input 352, printer 354, or display ..56 as needed, for example. The storage 360 may be a permanent storage medium such as a disk or tape in which case the' read/write device 358 provides access to this permanent storage medium. Alternatively, storage 360 may be any type of volatile storage such as RAM or microprocessor registers for example in which case the functionality of the read/write device 358 may be part of the functionality of the microprocessor.
In the above described examples, the suffix is determined by subtracting one from the current month, multiplying by 31, and adding the day. More generally, any technique of sortably representing the day and month in three digits may be used. For example, t:he month may be multiplied by any "month multiplier"' between 31 and 80 inclusive may be used to create a number which when added to the day will yield a number less than 1000, the requirement for three digit storage. Furthermore, if: a number greater than 31 is used, then steps 204,312, and ~~16 described previously are not required.. For example, i.f 32 is used, then for our November 25, 2012 date the suffix would simply be 11*32+15=377. The month would be recoverable from the suffix by dividing the suffix by the month multiplier (in our example 377/32 - 11) and the day would be recoverable by subtracting the month times th.e month multiplier from the suffix (in our example 377 - 11*32 - 25).
In the above e~:amples, the prefix and suffix are determined using numerical methods) and require no string manipulations. This is desirable because string manipulations are slow to perform. However, in the case that string manipulations are permissible, even though there is no apparent advantage to doing so, the three digits of the suffix and the three digits of t:he prefix may be arranged in any predetermined order since the suffix and prefix would still be recoverable. In addition, different methods of generating the prefix and suffix may be used which are self-evident from the above described numerical. methods.
Should input dates be available in the Julian format yy/ddd where ddd is from 1-366, the suffix may simply be selected. to equal the ddd field if it is understood that all dates will be in that format since this satisfies the requirerr~ent that the suffix be sortable and contain values less than 999. This however requires six digits to store the overloaded date where the' input only contained five digits.
In the above described Gregorian date overloading methods, a two digit day and a three digit month were compressed into a three digit suffix by taking advantage of the fact that a three digit suffix can hold numbers up to 999, and after allocating a capacity for a day value up to 31, the remaining capacity, namely 968 can be used to uniquely store the month as a multiple of a second number greater than 31.
For example, if the multiple chosen is 32, then a second number i.n the range of 0 to 968/32=30 can be represented in addition to the day value.
Where in the Gregorian example, this technique was used to store day and month information in a single suffix, this same technique can be used in representing the Julian day and year in a single field. In this case, a five digit field can hold numbers up to 99999. After allocating 366 for day values up to 366, there is a remaining capacity, namely 99999-366=99633 which is available for the year and century information. A second number may be stored as a multiple of some number greater than 366, for example 367. In this case, the second number can be between 0 and 99633/367 = 271. By selecting a base year of 1900 for example, any year from 1900 through to 1900 + 271 = 2171 may be represented in this manner.
A method of generating and decoding a five digit overloaded date from a five digit Julian date will now be described with reference to Figures 5 and 6. A base year must first be selected, and the method will be incapable of representing years prior to the base year. For the purposes of example, we will assume the base year is 1900. In step 500, an initial value foz- the five digit overloaded date is simply determined as the day information plus the year in century multiplied by a predetermined year multiplier which is greater than or equal to 367.
Next, the year in century value is compared to a pivot year value (step 502). If it is greater than the pivot year value, then an assumption is made that the year belongs to the century of the ba~~e year. In this case, the value computed thus far is the overloaded date. If it is less than the pivot year value, then an assumption is made that the year belongs to the century following the century of the base year.
In this case, a century offset equal to 100 times the year multiplier is added to the value computed thus far (step 504).
Alternatively, a century offset greater than 100 times the year multiplier may be added to the value computed thus far.
Two examples will be first given where the century offset is chosen to equa7_ 100 times the year multiplier.
Consider' for example the five digit Julian date 98032 which represents February 1, 1998, in a system using a pivot year of 30, and having a base year of 1900, a year multiplier of 367, and a century offset of 1.00 x year multiplier = 36700. In this case, the above described method results in a five digit overloaded date of 98 * 367 + 32 - 35998. For the five digit Julian date 25032, which represents February 1, 2025, the same parameters would result i.n a five digit overloaded date of 25 * 367 + 32 + 36700= 45907. If a four digit year (complete year information) is available, then the complete year minus the base year is multiplied by the year multiplier and added to the day information.
The same two e~!:amples will be next given where the century offset is chosen to be greater than 100 times the year multiplier. Consider for example the five digit Julian date 98032 which represents February 1, 1998, in a system using a pivot year of 30, and having a base year of 1900, a year multiplier of 367, and a century offset of 40000. In this case, the above described method results in a five digit overloaded date of 98 * ?.67 + 32 - 35998. For the five digit Julian date 25032, which represents February 1, 2025, the same parameters would result i.n a five digit overloaded date of 25 * 367 + 32 + 40000 = 49207.
Referring now t:o Figure 6, the decoding of a five digit overloaded date will be described. Of course, the particular steps taken tc> decode will depend upon the particular encoding step~~ used.
If a century offset other than 100 times the year multiplier is used, then if the five digit overloaded date is greater than the century offset (step 600), a starting point is selected which is the century fallowing the base year (step 602), and the century offset is subtracted from the five digit overloaded date (step 609:). Alternatively, if the five digit overloaded date is less than the century offset, then the starting point is set to the base year (step 606). The year in century is determined from the remaining overloaded date divided by the century multiplier (step 608). The days value is determined according t:o the remaining overloaded date minus the year in century times the year multiplier (step 610).
Finally, the five digit Julian date is determined according to year in century times 1000 plus days (step 612). If a four digit year is required, t:he year in century plus the starting point is used.
If a century offset equal to 100 times the year multiplier is used, then the same approach may be used to decode the Julian date. Alternatively, a years from base year value may be determined according to the five digit overloaded date divided by the year multiplier. The days value is determined according to t:he overloaded date minus the years from base year times the year multiplier. Finally, a seven digit Julian date is determined according to (years from base year plus the base year ) times 1000 plus days. If a two digit year is required, t:he first two digits can be stripped off in various ways. For example, a two digit year in century can be computed according to:
year in century = years from base year minus (years from base year/100) * 100.
In this case, a five digit Julian date is determined according to year in century times 1000 plus days.
By way of example, consider the first above example overloaded Julian date of: 35998, in the case where the century offset is 100 times the year multiplier, i.e. 36700. The year is determined according t:o 35998/367 = 98. The day is determined according to 35998 - 98*367=32. The Julian date is determined according to 98*1000+32=98032.
In the second above example, the overloaded Julian date was 45907 and the century offset was again 36700. In this case, 45907 is greater than 36700, so the starting paint is determined as the year 2000. The year in century is determined according to 1:45907 - 36700) /367 = 25. The days are determined according to (45907--36700) - 25*367 = 32. The five digit Julian date i~~ then 1000*25 + 32 = 25032.
Alternatively, for the second example, 45907 can be divided by the year multiplier to yield 125 as the years from base year.
In the third e~:ample, the overloaded Julian date was 35998 anal the century offset was 40000. The year is determined according to ..5998/367 = 98. The day is determined according to 35998 - 98*:~67=32. The Julian date is determined according to 98*1000+32=98032.
In the fourth example, the overloaded date was 49207 and the century offset was 40000. In this case, 49207 is greater than 40000, so the starting point is determined as the year 2000. The year in century is determined according to (49207 - 40000) /367 = 25. The days are determined according to (49207-40000) - 25*367 = 32. The five digit Julian date is then 1000*25 + 32 = 25032.
Any of the above described methods may be used to convert an entire array of dates to overloaded dates.
Alternatively, the methods may be used one at a time each time a date is accessed.
It is to be understood that any processing means capable of executing the above described methods could be used to implement the invention including computers, microprocessors, ASICs (application specific integrated circuits), FPGAs (field programmable gate arrays) etc.
The above conversion of a date to an overloaded date methods can be described in an even more generalized fashion as a series of operational steps to be performed on or with the aid of a computer for storing an overloaded date from a first date component con~~trained to be an integer in the range 1 .. N1, where N1 is an integer, and a second date component constrained to be an integer in the range 1 .. N2, where N2 is an integer, comprising the steps of:
a) multiplying the second value or the second value minus a predetermined offset by a second value multiplier K which is an integer greater than N1;
b) adding thE: result of step a) to the first value to get the overloaded date;
c) storing the overloaded date in memory.
Similarly, the above conversion of an overloaded date to a normal date methods can be described in an even more generalized fashion as a series of operational steps to be performed on or with the aid of a computer for reading a date having a. first date component constrained to be an integer in the range O..N1, where N7_ is an integer, and a second date component constrained to be an integer in the range O..N2, where N2 is an integer, from an overloaded date, comprising the steps of:
a) reading the overloaded date from memory;
b) dividing t:he overloaded date by a second value multiplier K which is an integer greater than N1 to get the second value;
c) subtracting the second value times the second value multiplier from the' overloaded date to get the first value.
For the Gregorian date overloading embodiment, the first and second date components are day and month values respectively. The day values are constrained to be in the range of one to thirty-one (N1 = 31), and the month values are constrained to be in the range of one to twelve (N2=12). The second value multiplier K in this case is a month multiplier which is greater than N1=:31, and preferably equal to 32.
For the Julian date overloading embodiment, the first and second date components are day and year values respectively. The day values are constrained to be in the range of one to 366 (N1 =. 366), and the year values are constrained to be in a range which is dependent upon the selection of the second value multiplier K, with the range increasing in size with ~omaller K. The second value multiplier in this case i.s a year multiplier which is greater than N1=366, and preferably equal t:o 367.
It is to be noted that in all of the above described embodiments, division is integer division meaning that only the output of any division step is only the integer part of the quotient.
Numerous modifications arid variations of the present invention are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims, the invention may be practised otherwise than as specifically described herein.
Claims (33)
1. A series of operational steps to be performed on or with the aid of a computer, said steps comprising:
a) whenever necessary, determining a six digit overloaded date from day, month and year information by performing the steps of:
a1) determining a three digit prefix from the year information which maintains sort order;
a2) determining a three digit suffix from the day and month information which maintains sort order; and a3) determining a six digit overloaded date by combining the three digit prefix and the three digit suffix.
a) whenever necessary, determining a six digit overloaded date from day, month and year information by performing the steps of:
a1) determining a three digit prefix from the year information which maintains sort order;
a2) determining a three digit suffix from the day and month information which maintains sort order; and a3) determining a six digit overloaded date by combining the three digit prefix and the three digit suffix.
2. A series of operational steps to be performed on or with the aid of a computer, said steps comprising:
a) whenever necessary determining day, month and year information from a six digit overloaded date by performing the steps of:
a1) determining a three digit prefix and a three digit suffix from the six digit overloaded date;
a2) determining the year information from the three digit prefix; and a3) determining the day and month information from the three digit suffix.
a) whenever necessary determining day, month and year information from a six digit overloaded date by performing the steps of:
a1) determining a three digit prefix and a three digit suffix from the six digit overloaded date;
a2) determining the year information from the three digit prefix; and a3) determining the day and month information from the three digit suffix.
3. A series of operational steps to be performed on or with the aid of a computer, said steps comprising:
a) whenever necessary, determining a six digit overloaded date from day, month and year information by performing the steps of:
a1) determining a three digit prefix from the year information which maintains sort order;
a2) determining a three digit suffix from the day and month information which maintains sort order;
a3) determining a six digit overloaded date by combining the three digit prefix and the three digit suffix;
b) whenever necessary determining day, month and year information from a six digit overloaded date by performing the steps of:
b1) determining a three digit prefix and a three digit suffix from the six digit overloaded date;
b2) determining the year information from the three digit prefix; and b3) determining the day and month information from the three digit suffix.
a) whenever necessary, determining a six digit overloaded date from day, month and year information by performing the steps of:
a1) determining a three digit prefix from the year information which maintains sort order;
a2) determining a three digit suffix from the day and month information which maintains sort order;
a3) determining a six digit overloaded date by combining the three digit prefix and the three digit suffix;
b) whenever necessary determining day, month and year information from a six digit overloaded date by performing the steps of:
b1) determining a three digit prefix and a three digit suffix from the six digit overloaded date;
b2) determining the year information from the three digit prefix; and b3) determining the day and month information from the three digit suffix.
4. A series of operational steps according to claim 1 wherein the year information comprises year within century information and wherein step a1) comprises the steps of:
i) determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information.
i) determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information.
5. A series of operational steps according to claim 1 wherein the year information comprises complete year information and wherein step a1) comprises the steps of:
i) determining the prefix to be the year information minus a predetermined base year.
i) determining the prefix to be the year information minus a predetermined base year.
6. A series of operational steps according to claim 1 wherein step a1) comprises the steps of:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information; and iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year.
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information; and iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year.
7. A series of operational steps according to claim 1 wherein step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information.
8. A series of operational steps according to claim 1 wherein step a2) comprises the steps of multiplying the month information by a predetermined month multiplier between 32 and 80 and adding the day information.
9. A series of operational steps according to claim 2 wherein step a1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix; and ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix.
i) dividing the six digit overloaded date by 1000 to get the three digit prefix; and ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix.
10. A series of operational steps according to claim 2 wherein step a2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index; and ii) subtracting 100 times the century index from the prefix to get the year information in year within century format.
i) dividing the three digit prefix by 100000 to get a century index; and ii) subtracting 100 times the century index from the prefix to get the year information in year within century format.
11. A series of operational steps according to claim 2 wherein step a2) comprises the step of adding a predetermined base year to the prefix to get the year information in complete format.
12. A series of operational steps according to claim 2 wherein step a3) comprises dividing the suffix by a predetermined month multiplier to get the month information, and subtracting the month information times the predetermined month multiplier from the suffix to get the day information.
13. A series of operational steps according to claim 2 wherein step a3) comprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
14. A series of operational steps according to claim 1 wherein step a1) comprises the steps of:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and. if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year; and wherein step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information.
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and. if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year; and wherein step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information.
15. A series of operational steps according to claim 1 wherein step a1) comprises the steps of:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year; and wherein step a2) comprises the steps of multiplying the month information by a predetermined month multiplier between 32 and 80 and adding the day information.
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year; and wherein step a2) comprises the steps of multiplying the month information by a predetermined month multiplier between 32 and 80 and adding the day information.
16. A series of operational steps according to claim 2 wherein step a1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix; and ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step a2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information in year within century format;
and wherein step a3) comprises dividing the suffix by a predetermined month multiplier between 32 and 80 to get the month information, and subtracting the month information times tree predetermined month multiplier from the suffix to get the day information.
i) dividing the six digit overloaded date by 1000 to get the three digit prefix; and ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step a2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information in year within century format;
and wherein step a3) comprises dividing the suffix by a predetermined month multiplier between 32 and 80 to get the month information, and subtracting the month information times tree predetermined month multiplier from the suffix to get the day information.
17. A series of operational steps according to claim 2 wherein step a1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step a2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information in year within century format;
and wherein step a3) comprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step a2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information in year within century format;
and wherein step a3) comprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
18. A series of operational steps according to claim 3 wherein step a1) comprises the steps of:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
wherein step a2) comprises the steps of multiplying the month information by a predetermined month multiplier between 32 and 80 and adding the day information;
wherein step b1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step b2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information;
and wherein step b3) comprises dividing the suffix by the predetermined month multiplier to get the month information, and subtracting the month information times the predetermined month multiplier from the suffix to get the day information.
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
wherein step a2) comprises the steps of multiplying the month information by a predetermined month multiplier between 32 and 80 and adding the day information;
wherein step b1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step b2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information;
and wherein step b3) comprises dividing the suffix by the predetermined month multiplier to get the month information, and subtracting the month information times the predetermined month multiplier from the suffix to get the day information.
19. A series of operational steps according to claim 3 wherein step a1) comprises the steps of:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
wherein step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information;
wherein step b1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step b2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information;
and wherein step b3) comprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
wherein step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information;
wherein step b1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step b2) comprises the steps of:
i) dividing the three digit prefix by 100000 to get a century index;
ii) subtracting 100 times the century index from the prefix to get the year information;
and wherein step b3) comprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
20. A series of operational steps according to claim 3 wherein step a1) comprises the steps of:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
wherein step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information;
wherein step b1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 tunes the prefix from the six digit overloaded date to get the three digit suffix;
wherein step b2) comprises the steps of:
adding a predetermined base year to the prefix to get the year information in complete form format;
and wherein step b3) comprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
wherein step a2) comprises the steps of subtracting one from the month information, multiplying by 31 and adding the day information;
wherein step b1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 tunes the prefix from the six digit overloaded date to get the three digit suffix;
wherein step b2) comprises the steps of:
adding a predetermined base year to the prefix to get the year information in complete form format;
and wherein step b3) comprises the steps of subtracting one from the suffix and then dividing by 31 to get a number of prior months, and adding one to the number of prior months to get the month information, and determining the day information to be the suffix minus the number of prior months times 31.
21. A series of operational steps according to claim 3 wherein step a1) comprises the steps of:
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
wherein step a2) comprises the steps of multiplying the month information by a predetermined month multiplier between 32 and 80 and adding the day information;
wherein step b1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step b2) comprises the steps of:
adding a predetermined base year to the prefix to get the year information in complete form format;
and wherein step b3) comprises dividing the suffix by the predetermined month multiplier to get the month information, and subtracting the month information times the predetermined month multiplier from the suffix to get the day information.
i) determining if the year information includes century information;
ii) if the result of step i) is false, determining if the year information is less than a predetermined pivot year and if so determining the three digit prefix to be one hundred plus the year information and if not determining the prefix to be the year information;
iii) if the result of step i) is true, determining the prefix to be the year information minus a predetermined base year;
wherein step a2) comprises the steps of multiplying the month information by a predetermined month multiplier between 32 and 80 and adding the day information;
wherein step b1) comprises the steps of:
i) dividing the six digit overloaded date by 1000 to get the three digit prefix;
ii) subtracting 1000 times the prefix from the six digit overloaded date to get the three digit suffix;
wherein step b2) comprises the steps of:
adding a predetermined base year to the prefix to get the year information in complete form format;
and wherein step b3) comprises dividing the suffix by the predetermined month multiplier to get the month information, and subtracting the month information times the predetermined month multiplier from the suffix to get the day information.
22. An apparatus comprising a computer programmed to perform a series of operational steps for storing an overloaded date from a first date component constrained to be an integer in the range 0 .. N1, where N1 is an integer, and a second date component constrained to be an integer in the range 0 .. N2, where N2 is an integer, the series of steps comprising:
a) multiplying the second value or the second value minus a predetermined offset by a second value multiplier K which is an integer greater than N1;
b) adding the result of step a) to the first value to get the overloaded date;
c) storing the overloaded date in memory.
a) multiplying the second value or the second value minus a predetermined offset by a second value multiplier K which is an integer greater than N1;
b) adding the result of step a) to the first value to get the overloaded date;
c) storing the overloaded date in memory.
23. An apparatus comprising a computer programmed to perform a series of operational steps for reading a date having a first date component constrained to be an integer in the range O..N1, where N1 is an integer, and a second date component constrained to be an integer in the range O..N2, where N2. is an integer, from an overloaded date, the series of steps comprising:
a) reading the overloaded date from memory;
b) dividing t:he overloaded date by a second value multiplier K which is an integer greater than N1 to get the second value;
c) subtracting the second value times the second value multiplier from the overloaded date to get the first value.
a) reading the overloaded date from memory;
b) dividing t:he overloaded date by a second value multiplier K which is an integer greater than N1 to get the second value;
c) subtracting the second value times the second value multiplier from the overloaded date to get the first value.
24. A series of operational steps to be performed on or with the aid of a computer, said steps comprising whenever necessary, determining a five digit overloaded date from day and year information by performing the steps of multiplying the year information by a year multiplier which is greater than 366 and adding the day information.
25. A series of operational steps according to claim 24 wherein the year multiplier is 367.
26. A series of operational steps according to claim 24 wherein the year information is in year within century format, further comprising the step of determining if the year within century information is less than a predetermined pivot year and if so adding a century offset greater than or equal to 100 times the year multiplier.
27. A series of operational steps according to claim 24 wherein the year information is complete year information, further comprising the step of subtracting a base year from the complete year information before multiplying by the year multiplier.
28. A series of operational steps according to claim 24 wherein the year information is in years from base year format.
29. A series of operational steps to be performed on or with the aid of a computer, said steps comprising whenever necessary determining day and year information from a five digit overloaded date by performing the steps of:
dividing the overloaded date by a predetermined year multiplier which is greater than 366 to get year information;
and subtracting the years information times the year multiplier from the overloaded date to get the day information.
dividing the overloaded date by a predetermined year multiplier which is greater than 366 to get year information;
and subtracting the years information times the year multiplier from the overloaded date to get the day information.
30. A series of operational steps according to claim 29 further comprising the steps of comparing the overloaded date to a predetermined century offset which is greater than or equal to 100 times the year multiplier;
if the overloaded date is greater than the century offset, subtracting 100 from the year information to get the year information in year within century format.
if the overloaded date is greater than the century offset, subtracting 100 from the year information to get the year information in year within century format.
31. A series of operational steps according to claim 29 further comprising the step of adding a base year to the year information to get four digit year information.
32. A series of operational steps according to claim 24 further comprising the steps of whenever necessary determining day and year information from a five digit overloaded date by performing the steps of:
dividing the overloaded date by said predetermined year multiplier to get year information; and subtracting the year information times the year multiplier from the overloaded date to get the day information.
dividing the overloaded date by said predetermined year multiplier to get year information; and subtracting the year information times the year multiplier from the overloaded date to get the day information.
33. A series of operational steps according to claim 26 wherein said steps of determining day and year information further comprise the steps of comparing the overloaded date to said century offset, and if the overloaded date is greater than they century offset subtracting 100 from the year information to get the year information in year within century format.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CA002238083A CA2238083A1 (en) | 1998-04-16 | 1998-05-20 | System and method for storing and processing date information capable of spanning centuries |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CA 2234991 CA2234991A1 (en) | 1998-04-16 | 1998-04-16 | System and method for storing and processing date information which spans more than one century |
CA2,234,991 | 1998-04-16 | ||
CA002238083A CA2238083A1 (en) | 1998-04-16 | 1998-05-20 | System and method for storing and processing date information capable of spanning centuries |
Publications (1)
Publication Number | Publication Date |
---|---|
CA2238083A1 true CA2238083A1 (en) | 1999-10-16 |
Family
ID=29402856
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CA002238083A Abandoned CA2238083A1 (en) | 1998-04-16 | 1998-05-20 | System and method for storing and processing date information capable of spanning centuries |
Country Status (1)
Country | Link |
---|---|
CA (1) | CA2238083A1 (en) |
-
1998
- 1998-05-20 CA CA002238083A patent/CA2238083A1/en not_active Abandoned
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5812841A (en) | Method and apparatus for recording and reading date data having coexisting formats | |
US5551020A (en) | System for the compacting and logical linking of data blocks in files to optimize available physical storage | |
US5761668A (en) | Method and apparatus for converting computer software and databases for the year 2000 | |
Peterson | Addressing for random-access storage | |
US6385612B1 (en) | Method for sorting and storing data employing dynamic sort tree reconfiguration in volatile memory | |
US5396622A (en) | Efficient radix sorting system employing a dynamic branch table | |
US5737735A (en) | Method and apparatus for recording and reading date data having coexisting formats | |
Cole | The preparation of examination time-tables using a small-store computer | |
US4611310A (en) | Method and system for rearranging data records in accordance with keyfield values | |
US5129070A (en) | Method of using the memory in an information processing system of the virtual addressing type, and apparatus for performing the method | |
US4555771A (en) | Data processing system for data base management of matrix type data | |
CA2166809C (en) | Data management using nested records and code points | |
US5519860A (en) | Central processor index sort followed by direct record sort and write by an intelligent control unit | |
Cranston et al. | A simplified recombination scheme for the Fibonacci buddy system | |
CA2238083A1 (en) | System and method for storing and processing date information capable of spanning centuries | |
Bloom | Some techniques and trade-offs affecting large data base retrieval times | |
US6055532A (en) | Method and apparatus for recording and reading date data having coexisting formats | |
CA2234991A1 (en) | System and method for storing and processing date information which spans more than one century | |
US6237002B1 (en) | Method for processing computerized date data which spans centuries | |
Brun | HBOOK: Statistical analysis and histogramming: Reference manual | |
Brown | Inside the APL2 workspace | |
Giles | Some considerations regarding arrangement of records on magnetic tape | |
JPS62287350A (en) | Index integrally updating system | |
JPS6143338A (en) | Searching of thin data base using association technology | |
JPS642970B2 (en) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
FZDE | Dead |