|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectogre.dms.util.DateUtil
public class DateUtil
| Constructor Summary | |
|---|---|
DateUtil()
|
|
| Method Summary | |
|---|---|
static Date |
add(Calendar startDate,
int field,
int amount)
|
static Date |
add(int field,
int amount)
|
static Date |
add(int year,
int month,
int date,
int field,
int amount)
|
static Date |
add(int year,
int month,
int date,
int hour,
int minute,
int second,
int field,
int amount)
|
static Calendar |
createCalendar(String date)
|
static int |
dayCounts(Date date1,
Date date2)
Day counts between two given dates. |
static String |
formatDateTime(Date aDate,
String aFormat)
將 Date 物件與以格式化後傳回日期時間字串,格式化字串可用的樣式請參考 SimpleDateFormat,此外,本方法增加民國年的樣式: eee。 |
static String |
getDateInFormat(Long date)
transform the date in Long to String visible format |
static long |
getEndOfDate(String date)
|
static long |
getStartOfDate(String date)
|
static String[] |
getTimeInteval(String timeString,
String mode)
|
static void |
main(String[] args)
|
static Date |
parseDateStringToDate(String dateStr,
String format)
Parse the dateStr to Date object. |
static String |
parseTimeFormatToString(long param)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateUtil()
| Method Detail |
|---|
public static Date add(int field,
int amount)
field - Refers to java.util.Calendaramount - the number to add to.
public static Date add(Calendar startDate,
int field,
int amount)
startDate - the start date objectfield - Refers to java.util.Calendaramount - the number to add to the start date.
public static Date add(int year,
int month,
int date,
int hour,
int minute,
int second,
int field,
int amount)
year - month - date - hour - intminute - intsecond - intfield - Refers to java.util.Calendaramount - the number to add to the start date.
public static Date add(int year,
int month,
int date,
int field,
int amount)
year - month - date - field - Refers to java.util.Calendaramount - the number to add to the start date.
public static int dayCounts(Date date1,
Date date2)
date1 - Datedate2 - Date
public static String formatDateTime(Date aDate,
String aFormat)
aDate - 日期物件aFormat - 格式化字串
public static String getDateInFormat(Long date)
public static Date parseDateStringToDate(String dateStr,
String format)
Date object.
dateStr - format -
null will be returned.public static long getStartOfDate(String date)
public static long getEndOfDate(String date)
public static Calendar createCalendar(String date)
public static void main(String[] args)
public static String parseTimeFormatToString(long param)
param: - date time in long format
public static String[] getTimeInteval(String timeString,
String mode)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||