TIBCO XPath Date/DateTime Function

compare-date

compare-date(first date, second date)

物件一定要轉成日期格式,否則會出現XmlAtomicValueCastException

first < second : -1

first = second : 0

first > second : 1

tib:compare-date(tib:parse-date('yyyy-MM-dd',tib:format-dateTime('yyyy-MM-dd', expDateTime)), current-date())

compare-dateTime

compare-dateTime(first dateTime, second dateTime)

判斷邏輯同compare-date

compare-time

compare-time(first time, second time)

判斷邏輯同compare-date

format-dateTime(format, dateTime)

(dateTime→text)

format dateTime to string based on the format pattern (target data type is string)

tib:format-dateTime('yyyy-MM-dd HH:mm:ss', current-dateTime())
tib:format-dateTime('yyyy-MM-dd', current-dateTime())

format-date(format, date)

(date→text, 一定要用date, 否則會出XmlAtomicValueParseException)

format date to string based on the format pattern

tib:format-date('yyyy-MM-dd', current-date())

format-time(format, time)

tib:format-time('HH:mm:ss', '10:25:00')

parse-dateTime(format, string)

(text→dateTime)

convert string to dateTime based on the format pattern (target data type is dateTime)

tib:parse-dateTime("yyyy-MM-dd'T'HH:mm:ss","2015-10-01T10:00:00")

parse-time(format, string)

(text→time)

tib:parse-time("yyyy-MM-dd'T'HH:mm:ss","2015-10-01T10:00:00")
[Result:10:00:00]

Reference

https://docs.tibco.com/pub/businessevents-standard/5.2.1/doc/html/GUID-969C3AC3-1C8D-4718-A9E4-1A63D08E48FD.html

http://www.factsandpeople.com/facts-mainmenu-5/22-tibco/248-format-datetime-problems-in-tibco-businessworks-and-general-interface

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s