Class ISODate
java.lang.Object
org.jpos.iso.ISODate
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatDate(Date d, String pattern) Formats a date object, using the default time zone for this host WARNING: See important issue related to date pattern.static StringformatDate(Date d, String pattern, TimeZone timeZone) You should use this version of formatDate() if you want a specific timeZone to calculate the date on.static StringFormatsdas a human-readable"Nd, Nh, Nm, Ns"string, omitting zero components.static StringgetANSIDate(Date d) Formats the given date.static StringgetANSIDate(Date d, TimeZone timeZone) Formats the given date.static StringFormats the given date.static StringFormats the given date.static StringgetDateTime(Date d) Formats the given date.static StringgetDateTime(Date d, TimeZone timeZone) Formats the given date.static StringFormats date as DD/MM/YY.static StringgetEuropeanDate(Date d, TimeZone timeZone) Formats date as DD/MM/YY in the given timezone.static StringFormats the given date.static StringgetExpirationDate(Date d, TimeZone timeZone) Formats the given date.static StringFormats the given date.static StringgetJulianDate(Date d, TimeZone timeZone) Formats the given date.static StringFormats the given date.static StringFormats the given date.static Dateconverts a string in DD/MM/YY format to a Date object Warning: return null on invalid dates (prints Exception to console) Uses default time zone for this hoststatic Dateconverts a string in DD/MM/YY format to a Date object Warning: return null on invalid dates (prints Exception to console)static Dateconverts a string in DD/MM/YY HH:MM:SS format to a Date object Warning: return null on invalid dates (prints Exception to console) Uses default time zone for this hoststatic DateparseDateTime(String s, TimeZone timeZone) converts a string in DD/MM/YY HH:MM:SS format to a Date object Warning: return null on invalid dates (prints Exception to console)static Datetry to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year)static DateparseISODate(String d, long currentTime) try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year)static DateparseISODate(String d, long currentTime, TimeZone timeZone) try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year)static DateparseISODate(String d, TimeZone timeZone) try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year)
-
Field Details
-
ONE_YEAR
-
-
Method Details
-
formatDate
Formats a date object, using the default time zone for this host WARNING: See important issue related to date pattern.- Parameters:
d- date object to be formattedpattern- to be used for formatting- Returns:
- the formatted date string
-
formatDate
You should use this version of formatDate() if you want a specific timeZone to calculate the date on. WARNING: See important issue related to date pattern.- Parameters:
d- date object to be formattedpattern- to be used for formattingtimeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- the formatted date string
-
parse
-
parse
converts a string in DD/MM/YY format to a Date object Warning: return null on invalid dates (prints Exception to console)- Parameters:
s- String in DD/MM/YY recorded in timeZonetimeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- parsed Date (or null)
-
parseDateTime
converts a string in DD/MM/YY HH:MM:SS format to a Date object Warning: return null on invalid dates (prints Exception to console) Uses default time zone for this host- Parameters:
s- the date string to parse- Returns:
- parsed Date (or null)
-
parseDateTime
converts a string in DD/MM/YY HH:MM:SS format to a Date object Warning: return null on invalid dates (prints Exception to console)- Parameters:
s- string in DD/MM/YY HH:MM:SS format recorded in timeZonetimeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- parsed Date (or null)
-
parseISODate
try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year)- Parameters:
d- date formated as [YY[YY]]MMDDhhmmss, typical field 13 + field 12- Returns:
- Date
-
parseISODate
try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year)- Parameters:
d- date formated as [YY[YY]]MMDDhhmmss, typical field 13 + field 12timeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- Date
-
parseISODate
try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year)- Parameters:
d- date formated as [YY[YY]]MMDDhhmmss, typical field 13 + field 12currentTime- currentTime in millis- Returns:
- Date
-
parseISODate
try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year)- Parameters:
d- date formated as [YY[YY]]MMDDhhmmss, typical field 13 + field 12currentTime- currentTime in millistimeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- Date
-
getDateTime
Formats the given date.- Parameters:
d- the date to format- Returns:
- date in MMddHHmmss format suitable for FIeld 7
-
getDateTime
Formats the given date.- Parameters:
d- date object to be formattedtimeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- date in MMddHHmmss format suitable for FIeld 7
-
getTime
-
getTime
-
getDate
-
getDate
-
getANSIDate
Formats the given date.- Parameters:
d- the date to format- Returns:
- date in yyMMdd format - suitable for ANSI field 8
-
getANSIDate
Formats the given date.- Parameters:
d- date object to be formattedtimeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- date in yyMMdd format - suitable for ANSI field 8
-
getEuropeanDate
Formats date as DD/MM/YY.- Parameters:
d- the date- Returns:
- formatted date string
-
getEuropeanDate
Formats date as DD/MM/YY in the given timezone.- Parameters:
d- the datetimeZone- the timezone- Returns:
- formatted date string
-
getExpirationDate
Formats the given date.- Parameters:
d- the date to format- Returns:
- date in yyMM format - suitable for field 14
-
getExpirationDate
Formats the given date.- Parameters:
d- date object to be formattedtimeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- date in yyMM format - suitable for field 14
-
getJulianDate
Formats the given date.- Parameters:
d- date object to be formatted- Returns:
- date in YDDD format suitable for bit 31 or 37 depending on interchange
-
getJulianDate
Formats the given date.- Parameters:
d- date object to be formattedtimeZone- for GMT for example, use TimeZone.getTimeZone("GMT") and for Uruguay use TimeZone.getTimeZone("GMT-03:00")- Returns:
- date in YDDD format suitable for bit 31 or 37 depending on interchange
-
formatDuration
Formatsdas a human-readable"Nd, Nh, Nm, Ns"string, omitting zero components.- Parameters:
d- duration to format- Returns:
- the formatted duration string
-