Michael Harness
Michael Harness

Reputation: 101

Tibco Businessworks Date Format

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.

Upvotes: 3

Views: 6479

Answers (4)

Sledgie
Sledgie

Reputation: 3

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

Upvotes: 0

NeerPatel
NeerPatel

Reputation: 863

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

Upvotes: 3

Saurav Kumar
Saurav Kumar

Reputation: 11

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())

Upvotes: 1

potzet
potzet

Reputation: 1

have you tried MMM in stead of MNn?

Upvotes: 0

Related Questions