public class DateTimeUtils extends Object
| Constructor and Description |
|---|
DateTimeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static long |
daysToMillis(int days) |
static long |
daysToMillis(int days,
TimeZone timeZone) |
static TimeZone |
defaultTimeZone() |
static int |
fromJavaDate(Date date)
Returns the number of days since epoch from java.sql.Date.
|
static long |
fromJavaTimestamp(Timestamp t)
Returns the number of micros since epoch from java.sql.Timestamp.
|
static int |
getDayOfMonth(int date)
Returns the 'day of month' value for the given date.
|
static int |
getMonth(int date)
Returns the month value for the given date.
|
static DateFormat |
getThreadLocalTimestampFormat(TimeZone timeZone) |
static int |
getYear(int date)
Returns the year value for the given date.
|
static int |
millisToDays(long millisUtc) |
static int |
millisToDays(long millisUtc,
TimeZone timeZone) |
static Date |
stringToTime(String s) |
static String |
timestampToString(long us,
TimeZone timeZone) |
static Date |
toJavaDate(int daysSinceEpoch)
Returns a java.sql.Date from number of days since epoch.
|
static Timestamp |
toJavaTimestamp(long us)
Returns a java.sql.Timestamp from number of micros since epoch.
|
public static int fromJavaDate(Date date)
public static int millisToDays(long millisUtc)
public static int millisToDays(long millisUtc,
TimeZone timeZone)
public static TimeZone defaultTimeZone()
public static long fromJavaTimestamp(Timestamp t)
public static DateFormat getThreadLocalTimestampFormat(TimeZone timeZone)
public static Timestamp toJavaTimestamp(long us)
public static Date toJavaDate(int daysSinceEpoch)
public static long daysToMillis(int days)
public static long daysToMillis(int days,
TimeZone timeZone)
public static int getYear(int date)
public static int getMonth(int date)
public static int getDayOfMonth(int date)
Copyright © 2019–2021 The Apache Software Foundation. All rights reserved.