Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Context-Dependent Date/Time String Processing Method

IP.com Disclosure Number: IPCOM000034043D
Original Publication Date: 1989-Jan-01
Included in the Prior Art Database: 2005-Jan-26
Document File: 2 page(s) / 13K

Publishing Venue

IBM

Related People

Cheng, JM: AUTHOR [+4]

Abstract

This invention relates to a computer-implemented method for mapping (1) Gregorian calendar dates and timestamps, and (2) 24-hour clock times into a compact representation; and for performing the inverse. The method comprises the steps during compression of (a) ascertaining the format of a source string by comparing said string formats with predefined formats, (b) validating the date/time values, and (c) storing said validated values as packed decimals in a predetermined format. The method further comprises the steps during expansion of (d) accessing a selected one of the compressed values, and (e) processing said selected one as a function of its application context.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 59% of the total text.

Page 1 of 2

Context-Dependent Date/Time String Processing Method

This invention relates to a computer-implemented method for mapping (1) Gregorian calendar dates and timestamps, and (2) 24-hour clock times into a compact representation; and for performing the inverse. The method comprises the steps during compression of (a) ascertaining the format of a source string by comparing said string formats with predefined formats, (b) validating the date/time values, and (c) storing said validated values as packed decimals in a predetermined format. The method further comprises the steps during expansion of (d) accessing a selected one of the compressed values, and (e) processing said selected one as a function of its application context. The method provides for translation and validation of coded strings in a variety of predefined formats into a single compressed string representation of the data value. The code fragment performing this translation and validation operates as follows (in block-structured pseudo-code): Begin; If the coded string contains a date

Then:

Scan string for first punctuation.

If punctuation is '/' then interpret as DATE-USA.

If punctuation is '-' then interpret as DATE-ISO.

If punctuation is '.' then interpret at DATE-EUR.

If the coded string contains a time

Then:

Continue scanning string for next punctuation.

If punctuation is ':' then interpret as TIME-USA or

TIME-JIS.

If punctuation is '.' then interpret as TIME-ISO or

TIME-EUR.

If the coded string contains a timestamp

Then:

Continue scanning string for end of microseconds.

Validate values for year, month, day, hour, minutes, seconds,

and microseconds.

Translate validated values into packed decimal and move them

into the result area in compressed string representation.

End; The algorithm provides for translation of coded strings in a variety of formats into a single compressed string representation of the data value. The compressed string representation of the data value has the following beneficial characteristics: The compressed string representation occupies less computer internal memory and DASD storage space. The amount of compression depends upon the interpretation of the source data string: ¿ If the source data string is interpreted as a

date, then the source data string is 8-10 bytes in

length and the compressed data string is 4 bytes

in the form x'yyyymmdd' represented in

hexadecimal; yyyy i...