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 int
compareTo(UTCDate o)
boolean
equals(Object obj)
int
get(TemporalField field)
LocalDate
getDatePart()
DayOfWeek
getDayOfWeek()
int
getDayOfYear()
LocalDate
getLocalDate()
LocalDateTime
getLocalDateTime()
LocalTime
getTimePart()
ZonedDateTime
getZonedDateTime(String timezone)
Creates a ZonedDateTime from this date as UTC in the supplied timezoneZonedDateTime
getZonedDateTime(ZoneId timezone)
UTCDate
inTimezone(String timezone)
Creates a new UTCDate from this date converted to a date/time in the supplied timezoneboolean
isAfter(UTCDate other)
boolean
isBefore(UTCDate other)
UTCDate
minus(long amount, TemporalUnit unit)
UTCDate
minus(Duration duration)
UTCDate
minus(Period period)
static UTCDate
of(int year, int month, int day)
static UTCDate
of(int year, int month, int day, int hour, int minute)
static UTCDate
of(int year, int month, int day, int hour, int minute, int second)
static UTCDate
of(long epochMilli)
UTCDate
plus(long amount, TemporalUnit unit)
UTCDate
plus(Duration duration)
UTCDate
plus(Period period)
UTCDate
setUseTime(boolean useTime)
double
toDouble()
long
toEpochMilli()
String
toONDATE()
String
toString()
boolean
useTime()
UTCDate
with(TemporalAdjuster adjuster)
UTCDate
with(TemporalField field, long value)
UTCDate
withString(String date)
UTCDate
withTimezone(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:
compareTo
in interfaceComparable<UTCDate>
-