|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dmonix.util.DateHandler
Utility class for managing dates and times.
Primarily used for formatting string into dates and vice versa.
Copyright: Copyright (c) Peter Nerg
Company: dmonix
| Field Summary | |
static java.text.SimpleDateFormat[] |
DATE_FORMATS
The built in default supported date formats. |
| Method Summary | |
static java.lang.String |
getDate(long millis,
java.lang.String dateFormat)
Formats the given time in milliseconds to a chosen format ex. yyyyy.MMMMM.dd kk:mm ex. yyyyy-MM-dd |
static java.util.Date |
getDate(java.lang.String dateString)
Parse a Date object from a date string. |
static java.util.Date |
getDate(java.lang.String dateString,
java.lang.String dateFormat)
Parse a Date object from a date string. |
static int |
getDaysBetweenDates(int startYear,
int startMonth,
int startDay,
int endYear,
int endMonth,
int endDay)
Returns the number of days between two dates. |
static long |
getMillis(int year,
int month,
int day)
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT for the given date. |
static long |
getMillis(int year,
int month,
int day,
int hour,
int minute)
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT for the given date. |
static long |
getMillis(int year,
int month,
int day,
int hour,
int minute,
int second)
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT for the given date. |
static long |
getMillis(int year,
int month,
int day,
int hour,
int minute,
int second,
int millis)
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT for the given date. |
static java.lang.String |
getToday(java.lang.String dateFormat)
Returns today in a formatted string ex. yyyy.MMMMM.dd kk:mm ex. yyyy-MM-dd |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.text.SimpleDateFormat[] DATE_FORMATS
| Method Detail |
public static java.lang.String getDate(long millis,
java.lang.String dateFormat)
millis - milliseconds since January 1, 1970, 00:00:00 GMTdateFormat - The format to return the string in
public static java.util.Date getDate(java.lang.String dateString)
dateString - The date string
DATE_FORMATS
public static java.util.Date getDate(java.lang.String dateString,
java.lang.String dateFormat)
dateString - The date stringdateFormat - The date format to use for the parse
public static int getDaysBetweenDates(int startYear,
int startMonth,
int startDay,
int endYear,
int endMonth,
int endDay)
startYear - start yearstartMonth - start month [1-12]startDay - start dayendYear - end yearendMonth - end month [1-12]endDay - end day
public static long getMillis(int year,
int month,
int day)
year - The yearmonth - The monthday - Day of the month
public static long getMillis(int year,
int month,
int day,
int hour,
int minute)
year - The yearmonth - The monthday - Day of the monthhour - The hourminute - The minute of the hour
public static long getMillis(int year,
int month,
int day,
int hour,
int minute,
int second)
year - The yearmonth - The monthday - Day of the monthhour - The hourminute - The minutes of the hoursecond - The seconds of the minute
public static long getMillis(int year,
int month,
int day,
int hour,
int minute,
int second,
int millis)
year - The yearmonth - The monthday - Day of the monthhour - The hourminute - The minutes of the hoursecond - The seconds of the minutemillis - The milliseconds of the second
public static java.lang.String getToday(java.lang.String dateFormat)
dateFormat - The format to return the string in
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||