object DateTimeUtils
A set of utilities to assist in bridging the gap to Java 8.
This class is not found in Java SE 8 but provides methods that are.
- Alphabetic
- By Inheritance
- DateTimeUtils
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toDate(instant: Instant): Date
Converts an
Instant
to ajava.util.Date
.Converts an
Instant
to ajava.util.Date
.Fractions of the instant smaller than milliseconds will be dropped.
- instant
the instant, not null
- returns
the util date, not null
- Exceptions thrown
IllegalArgumentException
if the conversion fails
-
def
toGregorianCalendar(zdt: ZonedDateTime): GregorianCalendar
Converts a
ZonedDateTime
to aCalendar
.Converts a
ZonedDateTime
to aCalendar
.The resulting
GregorianCalendar
is pure Gregorian and uses ISO week definitions, starting on Monday and with 4 days in a minimal week.Fractions of the instant smaller than milliseconds will be dropped.
- zdt
the zoned date-time, not null
- returns
the calendar, not null
- Exceptions thrown
IllegalArgumentException
if the conversion fails
-
def
toInstant(sqlTimestamp: Timestamp): Instant
Converts a
java.sql.Timestamp
to anInstant
.Converts a
java.sql.Timestamp
to anInstant
.- sqlTimestamp
the SQL timestamp, not null
- returns
the instant, not null
-
def
toInstant(utilDate: Date): Instant
Converts a
java.util.Date
to anInstant
.Converts a
java.util.Date
to anInstant
.- utilDate
the util date, not null
- returns
the instant, not null
-
def
toLocalDate(sqlDate: Date): LocalDate
Converts a
java.sql.Date
to aLocalDate
.Converts a
java.sql.Date
to aLocalDate
.- sqlDate
the SQL date, not null
- returns
the local date, not null
-
def
toLocalDateTime(sqlTimestamp: Timestamp): LocalDateTime
Converts a
java.sql.Timestamp
to aLocalDateTime
.Converts a
java.sql.Timestamp
to aLocalDateTime
.- sqlTimestamp
the SQL timestamp, not null
- returns
the local date-time, not null
-
def
toLocalTime(sqlTime: Time): LocalTime
Converts a
java.sql.Time
to aLocalTime
.Converts a
java.sql.Time
to aLocalTime
.- sqlTime
the SQL time, not null
- returns
the local time, not null
-
def
toSqlDate(date: LocalDate): Date
Converts a
LocalDate
to ajava.sql.Date
.Converts a
LocalDate
to ajava.sql.Date
.- date
the local date, not null
- returns
the SQL date, not null
-
def
toSqlTime(time: LocalTime): Time
Converts a
LocalTime
to ajava.sql.Time
.Converts a
LocalTime
to ajava.sql.Time
.- time
the local time, not null
- returns
the SQL time, not null
-
def
toSqlTimestamp(instant: Instant): Timestamp
Converts an
Instant
to ajava.sql.Timestamp
.Converts an
Instant
to ajava.sql.Timestamp
.- instant
the instant, not null
- returns
the SQL timestamp, not null
-
def
toSqlTimestamp(dateTime: LocalDateTime): Timestamp
Converts a
LocalDateTime
to ajava.sql.Timestamp
.Converts a
LocalDateTime
to ajava.sql.Timestamp
.- dateTime
the local date-time, not null
- returns
the SQL timestamp, not null
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
toTimeZone(zoneId: ZoneId): TimeZone
Converts a
ZoneId
to aTimeZone
.Converts a
ZoneId
to aTimeZone
.- zoneId
the zone, not null
- returns
the time-zone, not null
-
def
toZoneId(timeZone: TimeZone): ZoneId
Converts a
TimeZone
to aZoneId
.Converts a
TimeZone
to aZoneId
.- timeZone
the time-zone, not null
- returns
the zone, not null
-
def
toZonedDateTime(calendar: Calendar): ZonedDateTime
Converts a
Calendar
to aZonedDateTime
.Converts a
Calendar
to aZonedDateTime
.Note that
GregorianCalendar
supports a Julian-Gregorian cutover date andZonedDateTime
does not so some differences will occur.- calendar
the calendar, not null
- returns
the instant, not null
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )