Using format-dateTime in BusinessWorks 6.x.

Using format-dateTime in BusinessWorks 6.x.

book

Article ID: KB0074840

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks 6.x

Description

Using format-dateTime in BusinessWorks 5.x and 6.x is different. 
 
If you print "tib:format-dateTime("yyyyMMddHHmmss",current-dateTime())" in BW 5.x, you will see an output resembling 20150807105204. This is as expected.
 
If you try to use the same string in BW6.x like format-dateTime(current-dateTime(), "yyyyMMddHHmmss"), it will print "yyyyMMddHHmmss" and not throw an error. This is not as expected.

Issue/Introduction

Using format-dateTime in BusinessWorks 6.x.

Resolution

You will need to use the format-dateTime(current-dateTime(), "[Y0001][M01][D01][H01][m01][s01]") in BW 6.x to get the output below: 
20150807105204
 
To get milliseconds and timezone: format-dateTime(current-dateTime(), "[Y0001][M01][D01][H01][m01][s01].[f001] [z]")   
20200807015754.114 GMT-07:00

Additional Information

For complete syntax, please refer to following link:
https://platform.deloitte.com.au/articles/2013/formatting-dates-and-times-using-xslt-2.0-and-xpath