public class TimeUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static DateValue |
add(DateValue d,
DateValue dur) |
static int |
dayOfYear(int year,
int month,
int date)
the day of the year in [0-365] of the given date.
|
static int |
daysBetween(DateValue dv1,
DateValue dv2)
the number of days between two dates.
|
static int |
daysBetween(int y1,
int m1,
int d1,
int y2,
int m2,
int d2) |
static DateTimeValue |
dayStart(DateValue dv) |
static int |
fixedFromGregorian(int year,
int month,
int day)
the number of days since the epoch,
which is the imaginary beginning of year zero in a hypothetical
backward extension of the Gregorian calendar through time.
|
static DateTimeValue |
fromUtc(DateTimeValue date,
java.util.TimeZone zone) |
static DateValue |
fromUtc(DateValue date,
java.util.TimeZone zone) |
static boolean |
isLeapYear(int year) |
static int |
monthLength(int year,
int month)
count of days in the given month (one indexed) of the given year.
|
static long |
secsSinceEpoch(DateValue date)
Compute the number of seconds from the Proleptic Gregorian epoch
to the given time.
|
static DateTimeValue |
timeFromSecsSinceEpoch(long secsSinceEpoch)
Compute the gregorian time from the number of seconds since the
Proleptic Gregorian Epoch.
|
static java.util.TimeZone |
timeZoneForName(java.lang.String tzString)
returns the timezone with the given name or null if no such timezone.
|
static DateValue |
toDateValue(DateValue dv)
a DateValue with the same year, month, and day as the given instance that
is not a TimeValue.
|
static DateValue |
toUtc(DateValue date,
java.util.TimeZone zone) |
static java.util.TimeZone |
utcTimezone() |
static int |
yearLength(int year)
count of days inthe given year
|
public static java.util.TimeZone utcTimezone()
public static DateTimeValue fromUtc(DateTimeValue date, java.util.TimeZone zone)
public static int daysBetween(DateValue dv1, DateValue dv2)
dv1 - non null.dv2 - non null.public static int daysBetween(int y1,
int m1,
int d1,
int y2,
int m2,
int d2)
public static int fixedFromGregorian(int year,
int month,
int day)
public static boolean isLeapYear(int year)
public static int yearLength(int year)
public static int monthLength(int year,
int month)
public static int dayOfYear(int year,
int month,
int date)
public static DateTimeValue timeFromSecsSinceEpoch(long secsSinceEpoch)
public static long secsSinceEpoch(DateValue date)
public static DateTimeValue dayStart(DateValue dv)
public static DateValue toDateValue(DateValue dv)
public static java.util.TimeZone timeZoneForName(java.lang.String tzString)