public class ISODate
extends java.lang.Object
ISOUtil
Modifier and Type | Field and Description |
---|---|
static long |
ONE_YEAR |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
formatDate(java.util.Date d,
java.lang.String pattern)
Formats a date object, using the default time zone for this host
WARNING: See important issue related to date pattern.
|
static java.lang.String |
formatDate(java.util.Date d,
java.lang.String pattern,
java.util.TimeZone timeZone)
You should use this version of formatDate() if you want a specific
timeZone to calculate the date on.
|
static java.lang.String |
getANSIDate(java.util.Date d) |
static java.lang.String |
getANSIDate(java.util.Date d,
java.util.TimeZone timeZone) |
static java.lang.String |
getDate(java.util.Date d) |
static java.lang.String |
getDate(java.util.Date d,
java.util.TimeZone timeZone) |
static java.lang.String |
getDateTime(java.util.Date d) |
static java.lang.String |
getDateTime(java.util.Date d,
java.util.TimeZone timeZone) |
static java.lang.String |
getEuropeanDate(java.util.Date d) |
static java.lang.String |
getEuropeanDate(java.util.Date d,
java.util.TimeZone timeZone) |
static java.lang.String |
getExpirationDate(java.util.Date d) |
static java.lang.String |
getExpirationDate(java.util.Date d,
java.util.TimeZone timeZone) |
static java.lang.String |
getJulianDate(java.util.Date d) |
static java.lang.String |
getJulianDate(java.util.Date d,
java.util.TimeZone timeZone) |
static java.lang.String |
getTime(java.util.Date d) |
static java.lang.String |
getTime(java.util.Date d,
java.util.TimeZone timeZone) |
static java.util.Date |
parse(java.lang.String s)
converts 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 host
|
static java.util.Date |
parse(java.lang.String s,
java.util.TimeZone timeZone)
converts a string in DD/MM/YY format to a Date object
Warning: return null on invalid dates (prints Exception to console)
|
static java.util.Date |
parseDateTime(java.lang.String s)
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
|
static java.util.Date |
parseDateTime(java.lang.String s,
java.util.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 java.util.Date |
parseISODate(java.lang.String d)
try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year) |
static java.util.Date |
parseISODate(java.lang.String d,
long currentTime)
try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year) |
static java.util.Date |
parseISODate(java.lang.String d,
long currentTime,
java.util.TimeZone timeZone)
try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year) |
static java.util.Date |
parseISODate(java.lang.String d,
java.util.TimeZone timeZone)
try to find out suitable date given [YY[YY]]MMDDhhmmss format
(difficult thing being finding out appropiate year) |
public static final long ONE_YEAR
public static java.lang.String formatDate(java.util.Date d, java.lang.String pattern)
d
- date object to be formattedpattern
- to be used for formattingpublic static java.lang.String formatDate(java.util.Date d, java.lang.String pattern, java.util.TimeZone timeZone)
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")public static java.util.Date parse(java.lang.String s)
public static java.util.Date parse(java.lang.String s, java.util.TimeZone timeZone)
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")public static java.util.Date parseDateTime(java.lang.String s)
public static java.util.Date parseDateTime(java.lang.String s, java.util.TimeZone timeZone)
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")public static java.util.Date parseISODate(java.lang.String d)
d
- date formated as [YY[YY]]MMDDhhmmss, typical field 13 + field 12public static java.util.Date parseISODate(java.lang.String d, java.util.TimeZone timeZone)
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")public static java.util.Date parseISODate(java.lang.String d, long currentTime)
d
- date formated as [YY[YY]]MMDDhhmmss, typical field 13 + field 12currentTime
- currentTime in millispublic static java.util.Date parseISODate(java.lang.String d, long currentTime, java.util.TimeZone timeZone)
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")public static java.lang.String getDateTime(java.util.Date d)
public static java.lang.String getDateTime(java.util.Date d, java.util.TimeZone timeZone)
d
- date object to be formattedtimeZone
- for GMT for example, use TimeZone.getTimeZone("GMT")
and for Uruguay use TimeZone.getTimeZone("GMT-03:00")public static java.lang.String getTime(java.util.Date d)
public static java.lang.String getTime(java.util.Date d, java.util.TimeZone timeZone)
d
- date object to be formattedtimeZone
- for GMT for example, use TimeZone.getTimeZone("GMT")
and for Uruguay use TimeZone.getTimeZone("GMT-03:00")public static java.lang.String getDate(java.util.Date d)
public static java.lang.String getDate(java.util.Date d, java.util.TimeZone timeZone)
d
- date object to be formattedtimeZone
- for GMT for example, use TimeZone.getTimeZone("GMT")
and for Uruguay use TimeZone.getTimeZone("GMT-03:00")public static java.lang.String getANSIDate(java.util.Date d)
public static java.lang.String getANSIDate(java.util.Date d, java.util.TimeZone timeZone)
d
- date object to be formattedtimeZone
- for GMT for example, use TimeZone.getTimeZone("GMT")
and for Uruguay use TimeZone.getTimeZone("GMT-03:00")public static java.lang.String getEuropeanDate(java.util.Date d)
public static java.lang.String getEuropeanDate(java.util.Date d, java.util.TimeZone timeZone)
public static java.lang.String getExpirationDate(java.util.Date d)
public static java.lang.String getExpirationDate(java.util.Date d, java.util.TimeZone timeZone)
d
- date object to be formattedtimeZone
- for GMT for example, use TimeZone.getTimeZone("GMT")
and for Uruguay use TimeZone.getTimeZone("GMT-03:00")public static java.lang.String getJulianDate(java.util.Date d)
d
- date object to be formattedpublic static java.lang.String getJulianDate(java.util.Date d, java.util.TimeZone timeZone)
d
- date object to be formattedtimeZone
- for GMT for example, use TimeZone.getTimeZone("GMT")
and for Uruguay use TimeZone.getTimeZone("GMT-03:00")