Parse Date using RIDC

October 24, 2011

Recently, I had a need to parse a String which contained a date returned from executing search in WebCenter Content. 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.Time, javax.xml.bind.DatatypeConverter). After getting nowhere but receiving several parsing exceptions, a co-worker 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 WebCenter Content 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.

© 2020 Jason Stortz (version 20200322-120514)