|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.jiucai.appframework.common.util.BaseUtil
org.jiucai.appframework.base.util.DateTimeUtil
public class DateTimeUtil
DateTime 工具类 referer: http://joda-time.sourceforge.net/api-release/index.html
DateTime is the standard implementation of an unmodifiable datetime class. The pattern syntax is mostly compatible with java.text.SimpleDateFormat Symbol Meaning Presentation Examples ------ ------- ------------ ------- G era text AD C century of era (>=0) number 20 Y year of era (>=0) year 1996 x weekyear year 1996 w week of weekyear number 27 e day of week number 2 E day of week text Tuesday; Tue y year year 1996 D day of year number 189 M month of year month July; Jul; 07 d day of month number 10 a halfday of day text PM K hour of halfday (0~11) number 0 h clockhour of halfday (1~12) number 12 H hour of day (0~23) number 0 k clockhour of day (1~24) number 24 m minute of hour number 30 s second of minute number 55 S fraction of second number 978 z time zone text Pacific Standard Time; PST Z time zone offset/id zone -0800; -08:00; America/Los_Angeles ' escape for text delimiter '' single quote literal '
| 字段摘要 | |
|---|---|
protected static Locale |
DEFAULT_LOCALE
地区: 中国 |
protected static String |
DEFAULT_PATTERN
日期格式: 中国 |
protected static org.joda.time.DateTimeZone |
DEFAULT_TIMEZONE
时区:正八区 / (UTC+08:00)北京,重庆,香港特别行政区,乌鲁木齐 |
| 从类 org.jiucai.appframework.common.util.BaseUtil 继承的字段 |
|---|
log |
| 构造方法摘要 | |
|---|---|
DateTimeUtil()
|
|
| 方法摘要 | |
|---|---|
static String |
getCurrentTime()
返回当前系统时间 |
static org.joda.time.DateTime |
getDateTime(Date date)
转换 date 为 DateTime 对象 |
static org.joda.time.format.DateTimeFormatter |
getDateTimeFormatter(String pattern)
|
static org.joda.time.DateTime |
getDateTimeFromYearWeek(String yearWeek)
返回指定 年周(比如200953) 的第一天的日期 referer: http://joda-time.sourceforge.net/api-release/org/joda/time/format/DateTimeFormat.html |
static String |
getFormatedDate(Date date,
String pattern)
返回指定日期的字符串 |
static String |
getFormatedDate(int days,
String pattern)
返回指定日期的字符串 |
static String |
getFormatedDateTime(org.joda.time.DateTime dt,
String pattern)
返回格式化的字符串 |
static String |
getYearMonth(Date date)
获取指定日期的年月 |
static String |
getYearWeek(Date date)
获取指定日期的年周 |
static org.joda.time.DateTime |
parseDateTime(String date,
String pattern)
转换字符串为 DateTime 对象 |
| 从类 org.jiucai.appframework.common.util.BaseUtil 继承的方法 |
|---|
convertMapValue |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected static final String DEFAULT_PATTERN
protected static final Locale DEFAULT_LOCALE
protected static final org.joda.time.DateTimeZone DEFAULT_TIMEZONE
| 构造方法详细信息 |
|---|
public DateTimeUtil()
| 方法详细信息 |
|---|
public static org.joda.time.format.DateTimeFormatter getDateTimeFormatter(String pattern)
public static org.joda.time.DateTime parseDateTime(String date,
String pattern)
date - pattern -
public static org.joda.time.DateTime getDateTime(Date date)
date -
public static String getFormatedDateTime(org.joda.time.DateTime dt,
String pattern)
dt - pattern -
public static String getFormatedDate(Date date,
String pattern)
date - 指定的日期对象pattern - 格式字符串,可选,默认 yyyy-mm-dd
public static String getFormatedDate(int days,
String pattern)
days - 日期相差的天数pattern - 格式字符串,可选,默认 yyyy-mm-dd
public static String getYearMonth(Date date)
date - 日期对象
public static String getYearWeek(Date date)
date - 日期对象
public static org.joda.time.DateTime getDateTimeFromYearWeek(String yearWeek)
referer: http://joda-time.sourceforge.net/api-release/org/joda/time/format/DateTimeFormat.html
public static String getCurrentTime()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||