Troubleshooting
Problem
Yantra-7x ISO-DateFormat not matching with Java SimpleDateFormat
Symptom
Problem Statement:-
Yantra Publishes date in
YYYY-MM-DDTHH:MI:SS1HH:MI format and The customers want to create a Date object
out of this and use it in their code and SimpleDateFormat does not support
handing of the extra HH:MI for the timezone.
PART: Platform
Framework 7.0 Platform
PRODUCT: Product Management
COMPONENT:
API
OS: HP-UX - 11i
DATABASE: Oracle - 9.2.0.4
WEB SERVER:
WebLogic - 8.1 SP2
WEB BROWSER: Internet Explorer - 6.0 sp1
Cause
Resolving The Problem
Solutions:
There are multiple ways of creating a date object.
The simplest way is by calling YFCDate.getYFCDate method. This method
understands the format and decodes and creates the required date.
If they do not want to use our YFCDate, then the only option left is to
interpret the string and exclude the timezone piece of it and then create a
date.
For this, They have to do something like this:
String
aDateStrWithTZ = "2004-03-12T14:32:32-05:00";
String aDateStr =
aDateStrWithTZ.substring(0, aDateStrWithTZ.indexOf("T")+9);
Then use the
SimpleDateFormat.
Historical Number
PRI49294
Product Synonym
[<p><b>]Fact[</b><p>];
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21533117