public class Times extends Object
| 构造器和说明 |
|---|
Times() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
addDatehours(String day,
int x)
Add datehours string.
|
static String |
formatDate(Date date)
Format date.
|
static String |
formatTime(Date time,
String format)
Format time.
|
static String |
formatTime(long time)
Format time.
|
static String |
formatTime(long time,
String format)
Format time.
|
static String |
formatTime(Timestamp time)
Format time.
|
static String |
formatTime(Timestamp time,
String format)
Format time.
|
static Integer |
getDayByDate(String time)
获取某日期的天数.
|
static Integer |
getSpaceDayByDate(String dateStart,
String dateEnd)
获取2个日期间隔天数。
|
static Timestamp |
now()
当前的时间.
|
static Timestamp |
parseTime(Long appStartTime)
Parses the time.
|
static Timestamp |
parseTime(String data)
Parses the time.
|
static Timestamp |
parseTime(String data,
String format)
解析时间数据.
|
static Calendar |
parseTimeCalendar(String datetime)
解析时间格式为 Calendar 对象.
|
static Calendar |
parseTimeCalendar(String datetime,
String format)
解析时间格式为 Calendar 对象.
|
public static final Timestamp parseTime(String data, String format)
data - the dataformat - the formatpublic static final Timestamp parseTime(String data)
data - the datapublic static Timestamp parseTime(Long appStartTime)
appStartTime - the app start timepublic static final String formatTime(long time, String format)
time - the timeformat - the formatpublic static final String formatTime(Date time, String format)
time - the timeformat - the formatpublic static final String formatTime(long time)
time - the timepublic static final String formatTime(Timestamp time)
time - the timepublic static final String formatTime(Timestamp time, String format)
time - the timeformat - the formatpublic static Timestamp now()
public static String formatDate(Date date)
date - the datepublic static Calendar parseTimeCalendar(String datetime)
datetime - 时间字符串public static Calendar parseTimeCalendar(String datetime, String format)
datetime - 时间字符串format - 时间格式字符串public static Integer getDayByDate(String time)
time - the timepublic static Integer getSpaceDayByDate(String dateStart, String dateEnd) throws ParseException
dateStart - the date startdateEnd - the date endParseException - the parse exceptionCopyright © 2020. All rights reserved.