dateTimeFormat - Invalid Result - Month value is changed

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

Thanks!
Arul

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:

 
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'

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:

 
2007-08-30T08:37:00.001-06:00

Mark

Note that: (case sensitive)
M=month
m=minute
dd=date
ss=seconds
SS=milliseconds

All of these are defined in Built-in Services guide.

Thanks mcarlson, philk77, prp for your valuable suggestions.