DateTimeUtil

These methods are used to create date and time objects of the types used in BPM, as shown in the following tables. Parameters, such as seconds and minutes, should be in the range 0-59. Other parameters, such as year, month, day, hours, and seconds, should also be within normal ranges.

Type Name Factory Method
Date

This is a native type used in BPM for storing dates in YYYY-MM-DD format only.

createDate(int year, int month, int day)
createDate(Text isoFormatDate)

This ignores any timezone offset. For example: 2009-11-30T23:50:00-05:00 becomes 2009-11-30.

createDate(Datetime datetime)

This ignores any timezone offset.

createDate(Datetimetz datetime, Boolean normalize)

This is a Boolean that, if set to True, normalizes to Zulu time. For example, 2009-11-30T23:50:00-05:00 becomes 2009-12-01. If set to False, it strips timezone. The same example date becomes 2009-11-30.

createDate()

This creates a Date object set to today’s date.

Time createTime(int hour, int minute, int second, BigDecimal fractionalSecond)
createTime(int hour, int minute, int second, int millisecond)
createTime(Text isoFormatTime)

This ignores any timezone offset.

createTime(Datetime datetime)

This ignores any timezone offset.

createTime(Datetimetz datetimetz, Boolean normalize)

This is a Boolean that, if set to True, normalizes to Zulu time. If it is set to False, it strips timezone as with Date previously mentioned.

createTime()

This creates a Time object set to the current time.

Datetime createDatetime(BigInteger) year, int month, int day, int hour, int minute, int second, BigDecimal fractionalSecond)
createDatetime(int year, int month, int day, int hour, int minute, int second, int millisecond)
createDatetime(String lexicalRepresentation)

This creates a new Datetime by parsing the String as a lexical representation. The Timezone offset is to be set only if specified in the string.

createDatetime(Date date, Time time)

No timezone offset set.

createDatetime(Datetimetz datetime, Boolean normalize)

This is a Boolean that, if set to True, normalizes to Zulu time. If it is set to False, it strips timezone, as with Date above.

createDateTime()

This creates a Datetime object set to the current date and time.

Datetimetz createDatetimetz(BigInteger) year, int month, int day, int hour, int minute, int second, BigDecimal fractionalSecond, int timezone_offset)

This is a constructor allowing for complete value spaces allowed by W3C XML Schema 1.0 recommendation for xsd:dateTime and related built-in datatypes.

createDatetimetz(int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone_offset)

This is a constructor of value spaces that a java.util.GregorianCalendar instance would need to convert to an XMLGregorianCalendar instance.

createDatetimetz(Datetime datetime, Integer offset_minutes)
createDatetimetz(Date date, Time time, Integer offset_minutes)
createDatetimetz(String lexicalRepresentation)

This creates a new Datetimetz by parsing the String as a lexical representation. It takes the timezone offset from string, and defaults to zulu time if not specified.

createDateTimetz()

This creates a Datetimetz object set to the current date and time.

Duration createDuration(boolean isPositive, BigInteger years, BigInteger months, BigInteger days, BigInteger hours, BigInteger minutes, BigDecimal seconds)

This obtains a new instance of a Duration specifying the Duration as isPositive, years, months, days, hours, minutes and seconds.

createDuration(boolean isPositive, int years, int months, int days, int hours, int minutes, int seconds)

This obtains a new instance of a Duration specifying the Duration as isPositive, years, months, days, hours, minutes, seconds.

createDuration(long durationInMilliSeconds)

This obtains a new instance of a Duration specifying the Duration as milliseconds.

createDuration(String lexicalRepresentation)

This obtains a new instance of a Duration specifying the Duration as its string representation PnYnMnDTnHnMnS.