Package com.walkfares.calendar
Class UTCDate
java.lang.Object
com.walkfares.calendar.UTCDate
- All Implemented Interfaces:
Comparable<UTCDate>
- Direct Known Subclasses:
CurveDate,TimeZonedDate
public class UTCDate extends Object implements Comparable<UTCDate>
-
Constructor Summary
Constructors Constructor Description UTCDate()UTCDate(UTCDate ld)UTCDate(LocalDate ld)UTCDate(LocalDate datePart, LocalTime timePart)UTCDate(LocalDateTime ld)UTCDate(OffsetDateTime ld)UTCDate(ZonedDateTime ld) -
Method Summary
Modifier and Type Method Description intcompareTo(UTCDate o)booleanequals(Object obj)intget(TemporalField field)LocalDategetDatePart()DayOfWeekgetDayOfWeek()intgetDayOfYear()LocalDategetLocalDate()LocalDateTimegetLocalDateTime()LocalTimegetTimePart()ZonedDateTimegetZonedDateTime(String timezone)Creates a ZonedDateTime from this date as UTC in the supplied timezoneZonedDateTimegetZonedDateTime(ZoneId timezone)UTCDateinTimezone(String timezone)Creates a new UTCDate from this date converted to a date/time in the supplied timezonebooleanisAfter(UTCDate other)booleanisBefore(UTCDate other)UTCDateminus(long amount, TemporalUnit unit)UTCDateminus(Duration duration)UTCDateminus(Period period)static UTCDateof(int year, int month, int day)static UTCDateof(int year, int month, int day, int hour, int minute)static UTCDateof(int year, int month, int day, int hour, int minute, int second)static UTCDateof(long epochMilli)UTCDateplus(long amount, TemporalUnit unit)UTCDateplus(Duration duration)UTCDateplus(Period period)UTCDatesetUseTime(boolean useTime)doubletoDouble()longtoEpochMilli()StringtoONDATE()StringtoString()booleanuseTime()UTCDatewith(TemporalAdjuster adjuster)UTCDatewith(TemporalField field, long value)UTCDatewithString(String date)UTCDatewithTimezone(String timezone)Creates a new UTCDate from this date being the local date in the passed in timezone
-
Constructor Details
-
Method Details
-
setUseTime
-
useTime
public boolean useTime() -
isBefore
-
isAfter
-
plus
-
plus
-
plus
-
minus
-
minus
-
minus
-
getLocalDateTime
-
getZonedDateTime
-
getZonedDateTime
Creates a ZonedDateTime from this date as UTC in the supplied timezone- Parameters:
timezone- The ZoneId timezone- Returns:
- A ZonedDateTiome of this UTC Date
-
inTimezone
Creates a new UTCDate from this date converted to a date/time in the supplied timezone- Parameters:
timezone- The ZoneId timezone- Returns:
- The local version of this UTC date in the supplied timezone
-
withTimezone
Creates a new UTCDate from this date being the local date in the passed in timezone- Parameters:
timezone- The ZoneId timezone- Returns:
- The UTC version of this date in the supplied timezone
-
getLocalDate
-
getDatePart
-
getTimePart
-
get
-
with
-
getDayOfWeek
-
getDayOfYear
public int getDayOfYear() -
with
-
equals
-
toString
-
toONDATE
-
toDouble
public double toDouble() -
withString
-
toEpochMilli
public long toEpochMilli() -
of
-
of
-
of
-
of
-
compareTo
- Specified by:
compareToin interfaceComparable<UTCDate>
-