public class TimeUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static DBDate |
createDate()
Creates a Date object for the current local time.
|
static DBDate |
createDate(int year,
int month,
int day)
Creates a date for the given parameters.
|
static DBTime |
createTime()
Creates a Time object for the current local time.
|
static DBTime |
createTime(int hour,
int minute,
int second)
Creates a local time for the given parameters.
|
static DBTimestamp |
createTimestamp()
Creates a Timestamp object for the current local time.
|
static DBTimestamp |
createTimestamp(int hour,
int minute,
int second)
Creates a timestamp (local time) for the given time of the current day.
|
static DBTimestamp |
createTimestamp(int year,
int month,
int day,
int hour,
int minute,
int second)
Creates a timestamp (local time) for the given parameters.
|
static DBTimestamp |
createUtcTimestamp(int year,
int month,
int day,
int hour,
int minute,
int second)
Creates an UTC timestamp for the given parameters.
|
static DBTimestamp |
getSameTimeAnotherDay(DBTimestamp startTs,
int days)
Returns a new Timestamp rolled forward/backward by the given number of days
|
static java.lang.String |
toDurationString(long millis)
Converts the given millisecond value to a formatted duration string
of the d.hh:mm:ss.
|
static java.lang.String |
toDurationString(long millis,
boolean withSeconds)
Converts the given millisecond value to a formatted duration string.
|
static long |
toDurationValue(java.lang.String stringValue)
Returns the duration value described by a string of the format
d.hh:MM:ss whereas hh or MM are optional
|
static java.lang.String |
toNeutralFormat(java.util.Date date)
Formats the time value according to 'yyyy-MM-dd'
|
static java.lang.String |
toNeutralFormat(java.sql.Time time)
Formats the time value according to 'HH:mm:ss'
|
static java.lang.String |
toNeutralFormat(java.sql.Timestamp ts)
Formats the timestamp value according to 'yyyy-MM-dd HH:mm:ss'
|
static DBTimestamp |
toUtc(java.sql.Timestamp ts)
Converts the given Timestamp to UTC time.
|
public static DBTimestamp createUtcTimestamp(int year, int month, int day, int hour, int minute, int second)
public static DBTimestamp createTimestamp(int year, int month, int day, int hour, int minute, int second)
public static DBTimestamp createTimestamp(int hour, int minute, int second)
public static DBTimestamp createTimestamp()
public static DBTime createTime()
public static DBDate createDate()
public static DBDate createDate(int year, int month, int day)
public static DBTime createTime(int hour, int minute, int second)
public static DBTimestamp toUtc(java.sql.Timestamp ts)
public static java.lang.String toDurationString(long millis, boolean withSeconds)
public static java.lang.String toDurationString(long millis)
public static long toDurationValue(java.lang.String stringValue)
public static DBTimestamp getSameTimeAnotherDay(DBTimestamp startTs, int days)
public static java.lang.String toNeutralFormat(java.sql.Timestamp ts)
public static java.lang.String toNeutralFormat(java.sql.Time time)
public static java.lang.String toNeutralFormat(java.util.Date date)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.