TIBCO 'tib:parse-dateTime() function throws 'Unparseable date' exception.

TIBCO 'tib:parse-dateTime() function throws 'Unparseable date' exception.

book

Article ID: KB0089189

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Description:
============
On some environments <&lttib:parse-dateTime("MMM dd HH:mm:ss yyyy", "Jun 03 15:01:01 2010")>> or similar expression might throw:

<<&ltcom.tibco.xml.xquery.ExprException: Unparseable date: "Jun 03 15:01:01 2010">>>.

In above example, although the date seems to be fine, 'Jun' word is used as the abbreviation for English 'June' month name. In such case JVM language must be also set to English for BW to be able to properly parse that expression.

Environment:
============
TIBCO BusinessWorks™ (BW) all versions.

Cause:
======
Java method used to parse the dateTime function will use Regional Language settings to parse the date. If the date expression contains abbreviation for month names or day of the week names (e.g. Jan, Feb or Mon, Tue) the language setting for JVM must match the language used in the expression.

By default BW's JVM inherits the Regional Settings after the OS.

Resolution:
===========
Enable Trace.Startup=true tracing property end verify below setting in the startup banner of BW Engine:
user.language=en

This setting must show the same language that is used in month names or days of the week names otherwise mentioned exception will be thrown.

To resolve change the OS Regional Setting for language to match the language used in the date expression you want to parse.

Alternatively you can also override the OS Settings using below Engine property:
java.property.user.language=en

Issue/Introduction

TIBCO 'tib:parse-dateTime() function throws 'Unparseable date' exception.