public class UtilDateTime extends Object
| Constructor and Description |
|---|
UtilDateTime() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static Timestamp nowTimestamp()
public static Date nowDate()
public static Date toSqlDate(String date)
date - The date String: MM/DD/YYYYpublic static Date toSqlDate(String monthStr, String dayStr, String yearStr)
monthStr - The month StringdayStr - The day StringyearStr - The year Stringpublic static Date toSqlDate(int month, int day, int year)
month - The month intday - The day intyear - The year intpublic static Time toSqlTime(String time)
time - The time String: either HH:MM or HH:MM:SSpublic static Time toSqlTime(String hourStr, String minuteStr, String secondStr)
hourStr - The hour StringminuteStr - The minute StringsecondStr - The second Stringpublic static Time toSqlTime(int hour, int minute, int second)
hour - The hour intminute - The minute intsecond - The second intpublic static Timestamp toTimestamp(String dateTime)
dateTime - A combined data and time string in the format "MM/DD/YYYY HH:MM:SS", the seconds are optionalpublic static Timestamp toTimestamp(String date, String time)
date - The date String: MM/DD/YYYYtime - The time String: either HH:MM or HH:MM:SSpublic 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 Stringpublic 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 intpublic static Date toDate(String dateTime)
dateTime - A combined data and time string in the format "MM/DD/YYYY HH:MM:SS", the seconds are optionalpublic static Date toDate(String date, String time)
date - The date String: MM/DD/YYYYtime - The time String: either HH:MM or HH:MM:SSpublic 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 Stringpublic 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 intpublic static String toDateString(Date date)
date - The Datepublic static String toTimeString(Date date)
date - The Datepublic static String toTimeString(int hour, int minute, int second)
hour - The hour intminute - The minute intsecond - The second intpublic static String toDateTimeString(Date date)
date - The Datepublic static Timestamp monthBegin()
Copyright © 2015 Atlassian. All rights reserved.