Tibco Businessworks Date Format

5.8k Views Asked by At

I'm trying to format a date in Tibco Businessworks 6.2.2 in the following format:

06-AUG-2015 12:11 AM

I've found the picture string on several websites for xpath that, according to those who use them, will format the date like this. I've not been able to figure out how to only get the AUG instead of AUGUST without JUNE and JULY showing up as JUN and JUL.

Here is the xpath I'm using:

format-dateTime(current-dateTime(), '[D01]-[MNn, *-3]-[Y0001] [h01]:[m01] [PN]')

Here is the output I'm getting:

06-August-2015 12:11 AM

Any and all information is greatly appreciated.

4

There are 4 best solutions below

1
On

have you tried MMM in stead of MNn?

0
On

I used this function. (BW 5.12)

tib:format-dateTime('dd-MMM-yyyy hh:mm a', current-dateTime())

Out

06-Jul-2017 11:34 AM

1
On

In Tibco BW you can use substring on the final output - for the month'AUGUST' with index from 0 to 3. But this seems to be a work around.

A better approach is to write a common process of Date formtter with JavaCode activity from Java Palette. It doesn't and need any specific jar/lib import.

new SimpleDateFormat("yyyy-MMM-dd HH:mm a").format(new Date())
0
On

Try this :

format-dateTime(current-dateTime(), '[D01]-[MN, *-3]-[Y0001] [h01]:[m01] [PN]')

Output :

15-DEC-2015 05:56 P.M.

ref : http://www.w3.org/TR/xslt20/#date-time-examples