|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.jdon.util.UtilDateTime
public class UtilDateTime
Utility class for handling java.util.Date, the java.sql data/time classes and related information
| 构造方法摘要 | |
|---|---|
UtilDateTime()
|
|
| 方法摘要 | |
|---|---|
static String |
dateToMillis(long now)
save the datetime of System.currentTimeMillis() to dtatbase persistence. |
static String |
getDateTimeDisp(String datetime)
datetime is the String of System.currentTimeMillis() 返回标准中国(缺省)的时间显示格式 |
static Timestamp |
getDayEnd(Timestamp stamp)
|
static Timestamp |
getDayEnd(Timestamp stamp,
int daysLater)
|
static Timestamp |
getDayStart(Timestamp stamp)
|
static Timestamp |
getDayStart(Timestamp stamp,
int daysLater)
|
static Timestamp |
getNextDayStart(Timestamp stamp)
|
static Timestamp |
monthBegin()
Makes a Timestamp for the beginning of the month |
static Date |
nowDate()
Return a Date for right now |
static Timestamp |
nowTimestamp()
Return a Timestamp for right now |
static Date |
toDate(int month,
int day,
int year,
int hour,
int minute,
int second)
Makes a Date from separate ints for month, day, year, hour, minute, and second. |
static Date |
toDate(String dateTime)
Converts a date and time String into a Date |
static Date |
toDate(String date,
String time)
Converts a date String and a time String into a Date |
static Date |
toDate(String monthStr,
String dayStr,
String yearStr,
String hourStr,
String minuteStr,
String secondStr)
Makes a Date from separate Strings for month, day, year, hour, minute, and second. |
static String |
toDateString(Date date)
Makes a date String in the format MM/DD/YYYY from a Date |
static String |
toDateTimeString(Date date)
Makes a combined data and time string in the format "MM/DD/YYYY HH:MM:SS" from a Date. |
static Date |
toSqlDate(int month,
int day,
int year)
Makes a java.sql.Date from separate ints for month, day, year |
static Date |
toSqlDate(String date)
Converts a date String into a java.sql.Date |
static Date |
toSqlDate(String monthStr,
String dayStr,
String yearStr)
Makes a java.sql.Date from separate Strings for month, day, year |
static Time |
toSqlTime(int hour,
int minute,
int second)
Makes a java.sql.Time from separate ints for hour, minute, and second. |
static Time |
toSqlTime(String time)
Converts a time String into a java.sql.Time |
static Time |
toSqlTime(String hourStr,
String minuteStr,
String secondStr)
Makes a java.sql.Time from separate Strings for hour, minute, and second. |
static Timestamp |
toTimestamp(int month,
int day,
int year,
int hour,
int minute,
int second)
Makes a Timestamp from separate ints for month, day, year, hour, minute, and second. |
static Timestamp |
toTimestamp(String dateTime)
Converts a date and time String into a Timestamp |
static Timestamp |
toTimestamp(String date,
String time)
Converts a date String and a time String into a Timestamp |
static Timestamp |
toTimestamp(String monthStr,
String dayStr,
String yearStr,
String hourStr,
String minuteStr,
String secondStr)
Makes a Timestamp from separate Strings for month, day, year, hour, minute, and second. |
static String |
toTimeString(Date date)
Makes a time String in the format HH:MM:SS from a Date. |
static String |
toTimeString(int hour,
int minute,
int second)
Makes a time String in the format HH:MM:SS from a separate ints for hour, minute, and second. |
static String |
zeroPadString(String string,
int length)
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public UtilDateTime()
| 方法详细信息 |
|---|
public static Timestamp nowTimestamp()
public static Date nowDate()
public static Timestamp getDayStart(Timestamp stamp)
public static Timestamp getDayStart(Timestamp stamp,
int daysLater)
public static Timestamp getNextDayStart(Timestamp stamp)
public static Timestamp getDayEnd(Timestamp stamp)
public static Timestamp getDayEnd(Timestamp stamp,
int daysLater)
public static Date toSqlDate(String date)
date - The date String: MM/DD/YYYY
public static Date toSqlDate(String monthStr,
String dayStr,
String yearStr)
monthStr - The month StringdayStr - The day StringyearStr - The year String
public static Date toSqlDate(int month,
int day,
int year)
month - The month intday - The day intyear - The year int
public static Time toSqlTime(String time)
time - The time String: either HH:MM or HH:MM:SS
public static Time toSqlTime(String hourStr,
String minuteStr,
String secondStr)
hourStr - The hour StringminuteStr - The minute StringsecondStr - The second String
public static Time toSqlTime(int hour,
int minute,
int second)
hour - The hour intminute - The minute intsecond - The second int
public static Timestamp toTimestamp(String dateTime)
dateTime - A combined data and time string in the format
"MM/DD/YYYY HH:MM:SS", the seconds are optional
public static Timestamp toTimestamp(String date,
String time)
date - The date String: MM/DD/YYYYtime - The time String: either HH:MM or HH:MM:SS
public static Timestamp toTimestamp(String monthStr,
String dayStr,
String yearStr,
String hourStr,
String minuteStr,
String secondStr)
monthStr - The month StringdayStr - The day StringyearStr - The year StringhourStr - The hour StringminuteStr - The minute StringsecondStr - The second String
public static Timestamp toTimestamp(int month,
int day,
int year,
int hour,
int minute,
int second)
month - The month intday - The day intyear - The year inthour - The hour intminute - The minute intsecond - The second int
public static Date toDate(String dateTime)
dateTime - A combined data and time string in the format
"MM/DD/YYYY HH:MM:SS", the seconds are optional
public static Date toDate(String date,
String time)
date - The date String: MM/DD/YYYYtime - The time String: either HH:MM or HH:MM:SS
public static Date toDate(String monthStr,
String dayStr,
String yearStr,
String hourStr,
String minuteStr,
String secondStr)
monthStr - The month StringdayStr - The day StringyearStr - The year StringhourStr - The hour StringminuteStr - The minute StringsecondStr - The second String
public static Date toDate(int month,
int day,
int year,
int hour,
int minute,
int second)
month - The month intday - The day intyear - The year inthour - The hour intminute - The minute intsecond - The second int
public static String toDateString(Date date)
date - The Date
public static String toTimeString(Date date)
date - The Date
public static String toTimeString(int hour,
int minute,
int second)
hour - The hour intminute - The minute intsecond - The second int
public static String toDateTimeString(Date date)
date - The Date
public static Timestamp monthBegin()
public static final String zeroPadString(String string,
int length)
public static final String dateToMillis(long now)
now -
public static String getDateTimeDisp(String datetime)
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||