public interface IDateTimeProvider
IDateTimeProvider provides methods to access date and
time information for document generation. The
IDateTimeProvider can be referenced directly within a
document template by its name dateTimeProvider.
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCurrentDate()
Returns the current date as string.
|
java.lang.Long |
getCurrentDateTime_MilliSecondsSince_01_01_1970()
getCurrentDateTime_MilliSecondsSince_01_01_1970
Returns the current date and time messured in milli seconds since
01/01/1970.
|
java.lang.String |
getCurrentDateTime()
Returns the current date and time as string.
|
java.lang.String |
getCurrentTime()
Returns the current time as string.
|
java.lang.String |
printTimestampInCustomFormat(java.lang.Long milliSecondSince_01_01_1970,
java.lang.String pattern)
Allows you to format a date value (milli seconds since 01/01/1970)
into a string representation using any user-defined patterns for
date-time formatting.
|
java.lang.String |
printTimestampInISO8601Format(java.lang.Long milliSecondSince_01_01_1970,
boolean includingTime)
Formats a date value (milli seconds since 01/01/1970) into a string
representation according to ISO8601.
|
java.lang.String getCurrentDate()
java.lang.Long getCurrentDateTime_MilliSecondsSince_01_01_1970()
Returns the current date and time messured in milli seconds since 01/01/1970.
java.lang.String getCurrentDateTime()
java.lang.String getCurrentTime()
java.lang.String printTimestampInCustomFormat(java.lang.Long milliSecondSince_01_01_1970,
java.lang.String pattern)
Date and time formats are specified by date and time pattern
strings. Within date and time pattern strings, unquoted letters from
'A' to 'Z' and from 'a' to
'z' are interpreted as pattern letters representing the
components of a date or time string. Text can be quoted using single
quotes (') to avoid interpretation. "''"
represents a single quote. All other characters are not interpreted;
they're simply copied into the output string during formatting or
matched against the input string during parsing.
The following pattern letters are defined (all other characters from
'A' to 'Z' and from 'a' to
'z' are reserved):
Pattern letters are usually repeated, as their number determines the exact presentation:
Letter Date or Time Component Presentation Examples GEra designator Text ADyYear Year 1996;96MMonth in year Month July;Jul;07wWeek in year Number 27WWeek in month Number 2DDay in year Number 189dDay in month Number 10FDay of week in month Number 2EDay in week Text Tuesday;TueaAm/pm marker Text PMHHour in day (0-23) Number 0kHour in day (1-24) Number 24KHour in am/pm (0-11) Number 0hHour in am/pm (1-12) Number 12mMinute in hour Number 30sSecond in minute Number 55SMillisecond Number 978zTime zone General time zone Pacific Standard Time;PST;GMT-08:00ZTime zone RFC 822 time zone -0800
For parsing, if the number of pattern letters is more than 2, the year is interpreted literally, regardless of the number of digits. So using the pattern "MM/dd/yyyy", "01/11/12" parses to Jan 11, 12 A.D.
GMTOffsetTimeZone:
GMT Sign Hours : Minutes
Sign: one of
+ -
Hours:
Digit
Digit Digit
Minutes:
Digit Digit
Digit: one of
0 1 2 3 4 5 6 7 8 9
Hours must be between 0 and 23, and Minutes must be
between 00 and 59. The format is locale independent and digits must
be taken from the Basic Latin block of the Unicode standard.
RFC822TimeZone:
Sign TwoDigitHours Minutes
TwoDigitHours:
Digit Digit
TwoDigitHours must be between 00 and 23. Other definitions are
as for general time zones.
Date and Time Pattern Result "yyyy.MM.dd G 'at' HH:mm:ss z"2001.07.04 AD at 12:08:56 PDT"EEE, MMM d, ''yy"Wed, Jul 4, '01"h:mm a"12:08 PM"hh 'o''clock' a, zzzz"12 o'clock PM, Pacific Daylight Time"K:mm a, z"0:08 PM, PDT"yyyyy.MMMMM.dd GGG hh:mm aaa"02001.July.04 AD 12:08 PM"EEE, d MMM yyyy HH:mm:ss Z"Wed, 4 Jul 2001 12:08:56 -0700"yyMMddHHmmssZ"010704120856-0700"yyyy-MM-dd'T'HH:mm:ss.SSSZ"2001-07-04T12:08:56.235-0700
milliSecondSince_01_01_1970 - date time in milli seconds since
01/01/1970pattern - formatting patternjava.lang.String printTimestampInISO8601Format(java.lang.Long milliSecondSince_01_01_1970,
boolean includingTime)
milliSecondSince_01_01_1970 - date time in milli seconds since
01/01/1970includingTime - whether the time shall be included in the string
representation