Home > OracleWCM > Parse Date using RIDC

Parse Date using RIDC

October 24, 2011

Recently, I had a need to parse a String which contained a date returned from running a UCM search. The field in question was stored as an Oracle Database TIMESTAMP datatype (in the format 2010-02-04 06:00:00Z). I spent a while trying to parse it using the usual Java approaches (java.text.SimpleDateFormat,  java.sql.Timejavax.xml.bind.DatatypeConverter). After getting nowhere but receiving several parsing exceptions, a co-worker (thanks Wes Keppy) suggested I try using oracle.stellent.ridc.model.impl.DataObjectEncodingUtils.decodeDate to transform the String (in format 2010-02-04 06:00:00Z) to a Java Calendar object and it worked perfectly.

Since I was working in SSXA, the objects were using RIDC (Remote Intradoc Client). If I was within UCM and needed to parse a date, the intradoc.common.LocaleResources has methods that should be of some help. Sometimes it is best not to reinvent the wheel.
Advertisement
Categories: OracleWCM
Follow

Get every new post delivered to your Inbox.