public final class DateUtil extends Object
for possible iso patterns.
Constructor and Description |
---|
DateUtil() |
Modifier and Type | Method and Description |
---|---|
static Calendar |
createCalendar(TimeZone zone,
int year,
int month,
int dayofMonth,
int hour,
int min,
int sec,
int milli)
Creates a new CalendarInstance in the given time zone for the given time settings.
|
static Calendar |
createUTCCalendar(int year,
int month,
int dayofMonth,
int hour,
int min,
int sec,
int milli)
Creates a new CalendarInstance in the UTC time zone for the given time settings.
|
static TimeZone |
createUTCTimeZone(int offset)
Creates UTC Timezone with given offset in millisec.
|
static TimeZone |
createUTCTimeZone(int hour,
int minutes)
Creates UTC Timezone with given hour , minute offset.
|
static Calendar |
fromISOString(String isoStr)
Method parses a iso formated date.
|
static String |
tofullISOString(Calendar date)
Method formats a date to an iso formated string.
|
static String |
tofullISOString(Date date)
Method formats a date to an iso formated string.
|
static String |
toUTCISOString(Calendar date)
Method formats a date to an iso formated string.
|
static String |
toUTCISOString(Date date)
Method formats a date to an iso formated string.
|
public static Calendar createUTCCalendar(int year, int month, int dayofMonth, int hour, int min, int sec, int milli)
year
- the yearmonth
- the month (starting with index 1 (this is not like the
Calendar.set(int, int, int, int, int, int)
method).dayofMonth
- the day of month.hour
- the hour.min
- the min.sec
- the sec.milli
- the milli.public static Calendar createCalendar(TimeZone zone, int year, int month, int dayofMonth, int hour, int min, int sec, int milli)
zone
- time zone.year
- the yearmonth
- the month (starting with index 1 (this is not like the
Calendar.set(int, int, int, int, int, int)
method).dayofMonth
- the day of month.hour
- the hour.min
- the min.sec
- the sec.milli
- the milli.public static TimeZone createUTCTimeZone(int offset)
public static TimeZone createUTCTimeZone(int hour, int minutes)
hour
- the hour offset.minutes
- the minutes in the hour.public static Calendar fromISOString(String isoStr) throws IllegalArgumentException
isoStr
- the iso format string.IllegalArgumentException
- if isoStr can't be parsed.public static String toUTCISOString(Calendar date)
date
- public static String toUTCISOString(Date date)
public static String tofullISOString(Date date)
date
- the date.Copyright © 2004–2016 52north.org. All rights reserved.