DATETIME-TZ dataslot is defined as a dataslot representing a specific instant in time, measured down to seconds. It converts between string and date-time format. For getting the DateTimeTZ SVO, you must create the instance of DateTime object. BP Server does not provide any API that directly returns the DateTime type object. The DateTimeTZ SVO helps the operations on DATETIME-TZ type of dataslot.
BP Server provides the following API supported by the DATETIME-TZ type of dataslot.
DateFormat is an abstract class for date/time formatting subclasses which formats and parses dates or time in a language-independent manner. The date/time formatting subclass, such as SimpleDateFormat, allows for formatting date to text, parsing text to date, and normalization. The date is represented as a Date object or as milliseconds since January 1, 1970, 00:00:00 GMT.
DateFormat provides several class methods for obtaining the default date/time formatters based on the default or a given locale and a number of formatting styles. The formatting styles include FULL, LONG, MEDIUM, and SHORT. DateFormat helps to format and parse dates for any locale. You can keep your code completely independent of the locale conventions for months, days of the week, or even the calendar format (lunar / solar).
public java.lang.String getType()
Using this method, you can get the type in string format.
public java.sql.TimeStamp getValue()
You can get the TimeStamp value of this class.
public java.lang.String getStringValue()
Use this API to get the String value of this class.
public java.lang.String getStringValue(int dateStyle, int timeStyle)
You can get the String value of this class with the given date and time formatting style. The formatting style can be defined as:
DateFormat.SHORT which is numeric, such as 12.13.52 or 3:30pm.
DateFormat.MEDIUM which is longer, such as Jan 12, 1952.
DateFormat.LONG which is longer, such as January 12, 1952 or 3:30:32pm.
DateFormat.FULL which is completely specified, such as Tuesday, April 12, 1952 AD or 3:30:42pm PST.