Public 成员函数 | |
| Date | getDateByOffset (Date date, int calendarField, int offset) |
静态 Public 成员函数 | |
| static Date | getDateByFormat (String strDate, String format) |
| static String | getStringByOffset (String strDate, String format, int calendarField, int offset) |
| static String | getStringByOffset (Date date, String format, int calendarField, int offset) |
| static String | getStringByFormat (Date date, String format) |
| static String | getStringByFormat (String strDate, String format) |
| static String | getStringByFormat (long milliseconds, String format) |
| static String | getCurrentDate (String format) |
| static String | getCurrentDateByOffset (String format, int calendarField, int offset) |
| static int | getOffectDay (long milliseconds1, long milliseconds2) |
| static int | getOffectHour (long date1, long date2) |
| static int | getOffectMinutes (long date1, long date2) |
| static String | getFirstDayOfWeek (String format) |
| static String | getLastDayOfWeek (String format) |
| static String | getFirstDayOfMonth (String format) |
| static String | getLastDayOfMonth (String format) |
| static long | getFirstTimeOfDay () |
| static long | getLastTimeOfDay () |
| static boolean | isLeapYear (int year) |
| static String | formatDateStr2Desc (String strDate, String outFormat) |
| static String | getWeekNumber (String strDate, String inFormat) |
| static String | getTimeQuantum (String strDate, String format) |
| static String | getTimeDescription (long milliseconds) |
| static void | main (String[] args) |
静态 Public 属性 | |
| static final String | dateFormatYMDHMS = "yyyy-MM-dd HH:mm:ss" |
| static final String | dateFormatYMD = "yyyy-MM-dd" |
| static final String | dateFormatYM = "yyyy-MM" |
| static final String | dateFormatYMDHM = "yyyy-MM-dd HH:mm" |
| static final String | dateFormatMD = "MM/dd" |
| static final String | dateFormatHMS = "HH:mm:ss" |
| static final String | dateFormatHM = "HH:mm" |
| static final String | AM = "AM" |
| static final String | PM = "PM" |
静态 Private 成员函数 | |
| static String | getDayOfWeek (String format, int calendarField) |
© 2012 amsoft.cn 名称:AbDateUtil.java 描述:日期处理类.
|
inlinestatic |
描述:根据时间返回格式化后的时间的描述. 小于1小时显示多少分钟前 大于1小时显示今天+实际日期,大于今天全部显示实际时间
| strDate | the str date |
| outFormat | the out format |
|
inlinestatic |
描述:获取表示当前日期时间的字符串.
| format | 格式化字符串,如:"yyyy-MM-dd HH:mm:ss" |
|
inlinestatic |
描述:获取表示当前日期时间的字符串(可偏移).
| format | 格式化字符串,如:"yyyy-MM-dd HH:mm:ss" |
| calendarField | Calendar属性,对应offset的值, 如(Calendar.DATE,表示+offset天,Calendar.HOUR_OF_DAY,表示+offset小时) |
| offset | 偏移(值大于0,表示+,值小于0,表示-) |
|
inlinestatic |
描述:String类型的日期时间转化为Date类型.
| strDate | String形式的日期时间 |
| format | 格式化字符串,如:"yyyy-MM-dd HH:mm:ss" |
|
inline |
描述:获取偏移之后的Date.
| date | 日期时间 |
| calendarField | Calendar属性,对应offset的值, 如(Calendar.DATE,表示+offset天,Calendar.HOUR_OF_DAY,表示+offset小时) |
| offset | 偏移(值大于0,表示+,值小于0,表示-) |
|
inlinestaticprivate |
描述:获取本周的某一天.
| format | the format |
| calendarField | the calendar field |
|
inlinestatic |
描述:获取本月第一天.
| format | the format |
|
inlinestatic |
描述:获取本周一.
| format | the format |
|
inlinestatic |
描述:获取表示当前日期的0点时间毫秒数.
|
inlinestatic |
描述:获取本月最后一天.
| format | the format |
|
inlinestatic |
描述:获取本周日.
| format | the format |
|
inlinestatic |
描述:获取表示当前日期24点时间毫秒数.
|
inlinestatic |
描述:计算两个日期所差的天数.
| milliseconds1 | the milliseconds1 |
| milliseconds2 | the milliseconds2 |
|
inlinestatic |
描述:计算两个日期所差的小时数.
| date1 | 第一个时间的毫秒表示 |
| date2 | 第二个时间的毫秒表示 |
|
inlinestatic |
描述:计算两个日期所差的分钟数.
| date1 | 第一个时间的毫秒表示 |
| date2 | 第二个时间的毫秒表示 |
|
inlinestatic |
描述:Date类型转化为String类型.
| date | the date |
| format | the format |
|
inlinestatic |
描述:获取指定日期时间的字符串,用于导出想要的格式.
| strDate | String形式的日期时间,必须为yyyy-MM-dd HH:mm:ss格式 |
| format | 输出格式化字符串,如:"yyyy-MM-dd HH:mm:ss" |
|
inlinestatic |
描述:获取milliseconds表示的日期时间的字符串.
| milliseconds | the milliseconds |
| format | 格式化字符串,如:"yyyy-MM-dd HH:mm:ss" |
|
inlinestatic |
描述:获取指定日期时间的字符串(可偏移).
| strDate | String形式的日期时间 |
| format | 格式化字符串,如:"yyyy-MM-dd HH:mm:ss" |
| calendarField | Calendar属性,对应offset的值, 如(Calendar.DATE,表示+offset天,Calendar.HOUR_OF_DAY,表示+offset小时) |
| offset | 偏移(值大于0,表示+,值小于0,表示-) |
|
inlinestatic |
描述:Date类型转化为String类型(可偏移).
| date | the date |
| format | the format |
| calendarField | the calendar field |
| offset | the offset |
|
inlinestatic |
根据给定的毫秒数算得时间的描述.
| milliseconds | the milliseconds |
|
inlinestatic |
根据给定的日期判断是否为上下午.
| strDate | the str date |
| format | the format |
|
inlinestatic |
取指定日期为星期几.
| strDate | 指定日期 |
| inFormat | 指定日期格式 |
|
inlinestatic |
描述:判断是否是闰年()
(year能被4整除 并且 不能被100整除) 或者 year能被400整除,则该年为闰年.
| year | 年代(如2012) |
|
inlinestatic |
The main method.
| args | the arguments |
|
static |
上午.
|
static |
时分.
|
static |
时分秒.
|
static |
时间日期格式化到月日.
|
static |
时间日期格式化到年月.
|
static |
时间日期格式化到年月日.
|
static |
时间日期格式化到年月日时分.
|
static |
时间日期格式化到年月日时分秒.
|
static |
下午.
1.8.8