public final class TemporalUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DATE_EPOCH_OFFSET
The day number of the epoch date.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getDaysSinceEpoch(Date date)
Returns the day number since the epoch date.
|
static int |
getJulianDayNumber(Date date)
Returns the Julian day number of the date.
|
static int |
getJulianDayNumber(DateTime dateTime)
Returns the Julian day number of the date time.
|
static long |
getTimeOfDayNanos(Date date)
Returns the nano time of the julian day.
|
static long |
getTimeOfDayNanos(DateTime dateTime)
Returns the nano time of the julian day.
|
static int |
parseDate(String value)
Parses a
date value. |
static long |
parseTimestamp(String value)
Parses a
timestamp value. |
static String |
toDateString(int elapsedDays)
Returns a string representation of
Date. |
static int |
toElapsedDays(int daysSinceEpoch)
Returns the elapsed days from the epoch date.
|
static long |
toElapsedSeconds(int julianDayNumber,
long nanoTime)
Returns the elapsed days from Julian day.
|
static String |
toTimestampString(long elapsedSeconds)
Returns a string representation of
DateTime. |
public static final int DATE_EPOCH_OFFSET
public static int parseDate(String value)
date value.value - the date valueDate objectpublic static long parseTimestamp(String value)
timestamp value.value - the timestamp valueDateTime objectpublic static String toDateString(int elapsedDays)
Date.elapsedDays - the elapsed days from 0001/01/01public static String toTimestampString(long elapsedSeconds)
DateTime.elapsedSeconds - the elapsed seconds from 0001/01/01 00:00:00public static int getJulianDayNumber(Date date)
date - the datepublic static long getTimeOfDayNanos(Date date)
date - the daypublic static int getJulianDayNumber(DateTime dateTime)
dateTime - the date timepublic static long getTimeOfDayNanos(DateTime dateTime)
dateTime - the date timepublic static long toElapsedSeconds(int julianDayNumber,
long nanoTime)
julianDayNumber - the Julian daynanoTime - time of day in nanospublic static int getDaysSinceEpoch(Date date)
date - the target datetoElapsedDays(int)public static int toElapsedDays(int daysSinceEpoch)
daysSinceEpoch - the day number since epoch dategetDaysSinceEpoch(Date)Copyright © 2011–2018 Asakusa Framework Team. All rights reserved.