Difference between revisions of "Date and Time formats in Content Manager OnDemand"

Jump to navigation Jump to search
Added section 'Configuring CMOD Date Fields' to the CMOD Date & Time formats page.
m (Added a section on CMOD database queries using database native date formats, and the year function.)
(Added section 'Configuring CMOD Date Fields' to the CMOD Date & Time formats page.)
Line 4: Line 4:


One of the most important field types in IBM Content Manager OnDemand is Date and Time formats.  Timestamps appear in various locations in IBM CMOD -- Load IDs, the Segment Table, etc.  There has been a slow evolution of date and time stamps, culminating with a switch to database-native formats for the databases that OnDemand supports.  This article will explain the historical time formats, describe how to convert them in a variety of ways, and demonstrate how you can use IBM CMOD date formats for special reports.
One of the most important field types in IBM Content Manager OnDemand is Date and Time formats.  Timestamps appear in various locations in IBM CMOD -- Load IDs, the Segment Table, etc.  There has been a slow evolution of date and time stamps, culminating with a switch to database-native formats for the databases that OnDemand supports.  This article will explain the historical time formats, describe how to convert them in a variety of ways, and demonstrate how you can use IBM CMOD date formats for special reports.
== Configuring CMOD Date Fields ==
There are three places to configure date fields in Content Manager OnDemand.
=== Application Group Dates ===
When defining an Application Group, you can choose from the following date and time formats:
;Date
:The default date format for CMOD v9.0 and higher is the *internal* database date field format. 
:The ranges of dates that can be stored in these fields is dependent on the underlying database engine, but basically allow any reasonable date format from the year 0 to the year 9999.  This is far better than the default date formats in previous versions of CM OnDemand, since they only allowed a date range of January 1st 1970 to the year 2070.
;Date & Time
: Again, for CMOD v9.0 and higher, this is the default time format, which relies on the underlying date format provided by the database.
:Same as above, the database-native time format has far greater precision than the old format, able to specify to the microsecond.
; Date (old Style)
: Before database engines offered native date and time formats, dates were represented as an integer inside the database.
: A date of zero represented January 1st, 1970 - and 1 for January 2nd, 1970, and so on.  August 20th, 2016 is day number 17034.
: It was NOT possible to represent dates prior to 1970, or after 2070 with a date field in Content Manager OnDemand before v9.0.
; Date & Time (old Style)
: Similar to the old style date formats, time was represented as the number of seconds since January 1st, 1970, in the universal co-ordinated time zone ("UTC"). 
: This time format couldn't represent fractions of a second.
: The 'epoch' of January 1st, 1970 at 12:00am is a UNIX convention, for which date conversion functions already existed, which was probably why this format was chosen.
== Application Dates Formats ==
In order to load documents into Content Manager OnDemand, an Application definition must be configured, defining the format and locations and formats of metadata found in the documents (or the index file if one exists).  In the Application configuration window, in the "Load Information" tab, you can select a date or date / time format on the leftmost pane, then enter the date (and/or time) format on the right hand side of the tab.
This allows an Application to be configured to parse almost any existing date format, so it can be converted into the date field type defined at the Application Group level, and stored in the database.
== Folder Date Formats ==
Just a quick reminder:  Folders are a way to make searching Application Group metadata (with it's cryptic field names and internal data types) easier for end users, with human-readable field names, mapped values, pop-up lists, and date pickers.
When a user submits a query through a folder, they enter the date (and/or time) in the format specified in the Folder definition, which is then converted into the format defined in the Application Group, then the search is performed in the database, and the results are converted back into the Folder format, and displayed for the user.


== History ==
== History ==

Navigation menu