Package net.datenwerke.rs.utils.misc
Class DateUtils
java.lang.Object
net.datenwerke.rs.utils.misc.DateUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longValue to add to the day number returned by this calendar to find the Julian Day number.static final longNumber of milliseconds per hour, except when a leap second is inserted.static final longAll minutes have this many milliseconds except the last minute of the day on a day defined with a leap second. -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringformat(ZonedDateTime zonedDateTime) static Stringstatic Stringstatic StringformatDate(Date date, String format) static StringformatLocal(ZonedDateTime zonedDateTime) static StringformatLocal(Date date) static intgetDeltaDays(Date d1, Date d2) static longgetJulianDay(Calendar date) static longgetUnixDay(Calendar date) static Datestatic DatetoDate(LocalDateTime localDateTime) static ZonedDateTimetoZonedDateTime(Date date) static DatetrimDateInformation(Date date) static DatetrimSecondsAndMillis(Date date) static DatetrimTimeInformation(Date date)
-
Field Details
-
MILLISECS_PER_MINUTE
public static final long MILLISECS_PER_MINUTEAll minutes have this many milliseconds except the last minute of the day on a day defined with a leap second.- See Also:
-
MILLISECS_PER_HOUR
public static final long MILLISECS_PER_HOURNumber of milliseconds per hour, except when a leap second is inserted.- See Also:
-
EPOCH_UNIX_ERA_DAY
public static final long EPOCH_UNIX_ERA_DAYValue to add to the day number returned by this calendar to find the Julian Day number. This is the Julian Day number for 1/1/1970. Note: Since the unix Day number is the same from local midnight to local midnight adding JULIAN_DAY_OFFSET to that value results in the chronologist, historians, or calenderists Julian Day number. Refer to http://www.hermetic.ch/cal_stud/jdn.htm- See Also:
-
-
Method Details
-
getUnixDay
- Returns:
- Day number where day 0 is 1/1/1970, as per the Unix/Java date/time epoch.
-
getJulianDay
- Returns:
- LOCAL Chronologists Julian day number each day starting from midnight LOCAL TIME. Refer to http://tycho.usno.navy.mil/mjd.html for more information about local C-JDN
-
getDeltaDays
- Parameters:
d1-d2-- Returns:
- d2 - d1
-
formatDate
-
trimSecondsAndMillis
-
trimTimeInformation
-
trimDateInformation
-
formatCurrentDate
-
format
-
toZonedDateTime
-
format
-
formatLocal
-
formatLocal
-
toDate
-
toDate
-