public class CalendarUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
SWITCHOVER_DAYS |
static long |
SWITCHOVER_MILLIS |
| Modifier and Type | Method and Description |
|---|---|
static int |
convertDate(int original,
boolean fromProleptic,
boolean toProleptic) |
static int |
convertDateToHybrid(int proleptic)
Convert an epoch day from the proleptic Gregorian calendar to the hybrid
Julian/Gregorian.
|
static int |
convertDateToProleptic(int hybrid)
Convert an epoch day from the hybrid Julian/Gregorian calendar to the
proleptic Gregorian.
|
static long |
convertTime(long original,
boolean fromProleptic,
boolean toProleptic) |
static long |
convertTimeToHybrid(long proleptic)
Convert epoch millis from the proleptic Gregorian calendar to the hybrid
Julian/Gregorian.
|
static long |
convertTimeToProleptic(long hybrid)
Convert epoch millis from the hybrid Julian/Gregorian calendar to the
proleptic Gregorian.
|
static String |
formatDate(long epochDay,
boolean useProleptic)
Formats epoch day to date according to proleptic or hybrid calendar
|
static String |
formatTimestamp(long epochMillis,
boolean useProleptic)
Formats epoch Millis to timestamp according to proleptic or hybrid calendar
|
public static final long SWITCHOVER_MILLIS
public static final long SWITCHOVER_DAYS
public static int convertDateToProleptic(int hybrid)
hybrid - day of epoch in the hybrid Julian/Gregorianpublic static int convertDateToHybrid(int proleptic)
proleptic - day of epoch in the proleptic Gregorianpublic static int convertDate(int original,
boolean fromProleptic,
boolean toProleptic)
public static long convertTime(long original,
boolean fromProleptic,
boolean toProleptic)
public static long convertTimeToProleptic(long hybrid)
hybrid - millis of epoch in the hybrid Julian/Gregorianpublic static long convertTimeToHybrid(long proleptic)
proleptic - millis of epoch in the proleptic Gregorianpublic static String formatDate(long epochDay, boolean useProleptic)
epochDay - epoch dayuseProleptic - if true - uses proleptic formatter, else uses hybrid formatterpublic static String formatTimestamp(long epochMillis, boolean useProleptic)
epochMillis - epoch MillisuseProleptic - if true - uses proleptic formatter, else uses hybrid formatterCopyright © 2021 The Apache Software Foundation. All rights reserved.