DfTime Patterns

A few weeks ago I had a discussion with one of my engineers about time formats. He was working on a Documentum application that read the Docbase and produced a metadata file to be consumed by another application. Some of the metadata this application processed were dates (dm_time) that needed to be in a particular format. This lead to a discussion of DfTime.DF_TIME_PATTERNs and whether they actually worked, and did they always make sense.

Well, we proved that they work (see the following table as a quick reference). As to whether they make sense or not, you decide. I can say that find it a little annoying that the only format that includes the AM/PM indicator is the DF_TIME_PATTERN_DEFAULT, and patterns like DF_TIME_PATTERN27 and DF_TIME_PATTERN28, I would be tempted to implement as DfTime.getYear().

The pattern formats don’t seem to follow the Java conventions for SimpleDateFormat either. For instance, formats that use “hh” for hour I would expect to display 1-12; however, they display 00-23 instead (this is “H” in Java’s SimpleDateFormat class). As you can see from the custom patterns in the table, there is also no distinction between “hh” and “HH”, and “mm” and “mi” making your options for custom date formats somewhat limited.

DF_TIME_PATTERN_DEFAULT mm/dd/yyyy hh:mi:ss a (this is a guess since the DFC JavaDocs use a blank here) 12/3/2010 4:24:38 PM
DF_TIME_PATTERN1 mm/dd/yy 12/03/10
DF_TIME_PATTERN2 mm/dd/yyyy 12/03/2010
DF_TIME_PATTERN3 dd-mon-yy 03-Dec-10
DF_TIME_PATTERN4 dd-mon-yyyy 03-Dec-2010
DF_TIME_PATTERN5 month dd yy December 03 10
DF_TIME_PATTERN6 month dd, yy December 03, 10
DF_TIME_PATTERN7 month dd yyyy December 03 2010
DF_TIME_PATTERN8 month dd, yyyy December 03, 2010
DF_TIME_PATTERN9 mon dd yy Dec 03 10
DF_TIME_PATTERN10 mon dd yyyy Dec 03 2010
DF_TIME_PATTERN11 mm/yy 12/10
DF_TIME_PATTERN12 mm/yyyy 12/2010
DF_TIME_PATTERN13 dd/mm/yy 03/12/10
DF_TIME_PATTERN14 dd/mm/yyyy 03/12/2010
DF_TIME_PATTERN15 mm/yy hh:mi:ss 12/10 16:24:38
DF_TIME_PATTERN16 mm/yyyy hh:mi:ss 12/2010 16:24:38
DF_TIME_PATTERN17 dd/mm/yy hh:mi:ss 03/12/10 16:24:38
DF_TIME_PATTERN18 dd/mm/yyyy hh:mi:ss 03/12/2010 16:24:38
DF_TIME_PATTERN19 yy/mm 10/12
DF_TIME_PATTERN20 yyyy/mm 2010/12
DF_TIME_PATTERN21 yy/mm/dd 10/12/03
DF_TIME_PATTERN22 yyyy/mm/dd 2010/12/03
DF_TIME_PATTERN23 yy/mm hh:mi:ss 10/12 16:24:38
DF_TIME_PATTERN24 yyyy/mm hh:mi:ss 2010/12 16:24:38
DF_TIME_PATTERN25 yy/mm/dd hh:mi:ss 10/12/03 16:24:38
DF_TIME_PATTERN26 yyyy/mm/dd hh:mi:ss 2010/12/03 16:24:38
DF_TIME_PATTERN27 yy 10
DF_TIME_PATTERN28 yyyy 2010
DF_TIME_PATTERN29 mon-yy Dec-10
DF_TIME_PATTERN30 mon-yyyy Dec-2010
DF_TIME_PATTERN31 yy hh:mi:ss 10 16:24:38
DF_TIME_PATTERN32 yyyy hh:mi:ss 2010 16:24:38
DF_TIME_PATTERN33 mon-yy hh:mi:ss Dec-10 16:24:38
DF_TIME_PATTERN34 mon-yyyy hh:mi:ss Dec-2010 16:24:38
DF_TIME_PATTERN35 month yy December 10
DF_TIME_PATTERN36 month yyyy December 2010
DF_TIME_PATTERN37 month, yy December, 10
DF_TIME_PATTERN38 month, yyyy December, 2010
DF_TIME_PATTERN39 month yy hh:mi:ss December 10 16:24:38
DF_TIME_PATTERN40 month yyyy hh:mi:ss December 2010 16:24:38
DF_TIME_PATTERN41 month, yy hh:mi:ss December, 10 16:24:38
DF_TIME_PATTERN42 month, yyyy hh:mi:ss December, 2010 16:24:38
DF_TIME_PATTERN43 mm/dd/yy hh:mi:ss 12/03/10 16:24:38
DF_TIME_PATTERN44 mm/dd/yyyy hh:mi:ss 12/03/2010 16:24:38
DF_TIME_PATTERN45 yyyy-mm-dd 2010-12-03
DF_TIME_PATTERN46 yyyyMMddHHmmss 20101203162438
Custom MM-dd-yyyy HH:mi:ss a 12-03-2010 16:24:38 PM
Custom MM-dd-yyyy hh:mi:ss a 12-03-2010 16:24:38 PM
Custom yyyyMMdd-hhmiss 20101203-162438
Custom yyyyMMdd-HHmmss 20101203-162438
Advertisements

About Scott
I have been implementing Documentum solutions since 1997. In 2005, I published a book about developing Documentum solutions for the Documentum Desktop Client (ISBN 0595339689). In 2010, I began this blog as a record of interesting and (hopefully) helpful bits of information related to Documentum, and as a creative outlet.

2 Responses to DfTime Patterns

  1. Pingback: DFC Constants Can Be Insightful « dm_misc: Miscellaneous Documentum Tidbits and Information

  2. Pingback: One Year Ago « dm_misc: Miscellaneous Documentum Tidbits and Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: