dateTimeFormat - Invalid Result - Month value get changed
I am using BIS “WmPublic/pub.date:dateTimeFormat” to convert new pattern.
My inputs are–>
inString = 20070812T200806.000Z
currentPattern - yyyyMMDD’T’hhmmss.sss’Z’
newPattern - yyyy-MM-dd HH:mm:ss.S
locale - en
Output which i am getting,
value - 2007-01-12 20:08:00.0
Problem is, In input month value is 08(auguest) and output is 01(January).
Month value is changed.
Can you please clarify this?
Environment Details : Wm61
yyyyMMDD’T’hhmmss.sss’Z’ ← old
yyyyMMdd’T’hhmmss.sss’Z’ ← suggested
You have to change in the currentPattern variable of the service
Thanks a lot !.
I have changed as per your suggestion. Its coming properly now…
By the way, these two patterns (old and suggested) seem to almost match that of an XML schema dateTime format. However, in order to match that, the patterns would need to be:
You should also be aware that this form of the XML schema dateTime pattern expresses all dates in GMT or UTC time. Additional logic is needed to parse XML schema dateTimes containing timezone offsets such as the one below which represents Aug 7, 2007 at 8:37 AM in the US Mountain timezone:
Note that: (case sensitive)
All of these are defined in Built-in Services guide.
Thanks mcarlson, philk77, prp for your valuable suggestions.