public class Grego extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
MAX_MILLIS |
static int |
MILLIS_PER_DAY |
static int |
MILLIS_PER_HOUR |
static int |
MILLIS_PER_MINUTE |
static int |
MILLIS_PER_SECOND |
static long |
MIN_MILLIS |
| Constructor and Description |
|---|
Grego() |
| Modifier and Type | Method and Description |
|---|---|
static int |
dayOfWeek(long day)
Return the day of week on the 1970-epoch day
|
static int[] |
dayToFields(long day,
int[] fields) |
static long |
fieldsToDay(int year,
int month,
int dom)
Convert a year, month, and day-of-month, given in the proleptic
Gregorian calendar, to 1970 epoch days.
|
static long |
floorDivide(long numerator,
long denominator) |
static int |
getDayOfWeekInMonth(int year,
int month,
int dayOfMonth) |
static boolean |
isLeapYear(int year)
Return true if the given year is a leap year.
|
static int |
monthLength(int year,
int month)
Return the number of days in the given month.
|
static int |
previousMonthLength(int year,
int month)
Return the length of a previous month of the Gregorian calendar.
|
static int[] |
timeToFields(long time,
int[] fields) |
static String |
timeToString(long time)
Convenient method for formatting time to ISO 8601 style
date string.
|
public static final long MIN_MILLIS
public static final long MAX_MILLIS
public static final int MILLIS_PER_SECOND
public static final int MILLIS_PER_MINUTE
public static final int MILLIS_PER_HOUR
public static final int MILLIS_PER_DAY
public static final boolean isLeapYear(int year)
year - Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.public static final int monthLength(int year,
int month)
year - Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.month - 0-based month, with 0==Janpublic static final int previousMonthLength(int year,
int month)
year - Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.month - 0-based month, with 0==Janpublic static long fieldsToDay(int year,
int month,
int dom)
year - Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.month - 0-based month, with 0==Jandom - 1-based day of monthpublic static int dayOfWeek(long day)
day - the 1970-epoch day (integral value)public static int[] dayToFields(long day,
int[] fields)
public static int[] timeToFields(long time,
int[] fields)
public static long floorDivide(long numerator,
long denominator)
public static int getDayOfWeekInMonth(int year,
int month,
int dayOfMonth)
public static String timeToString(long time)
time - long time