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
Instantto ajava.util.Date.Converts an
Instantto 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
IllegalArgumentExceptionif the conversion fails
-
def
toGregorianCalendar(zdt: ZonedDateTime): GregorianCalendar
Converts a
ZonedDateTimeto aCalendar.Converts a
ZonedDateTimeto aCalendar.The resulting
GregorianCalendaris 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
IllegalArgumentExceptionif the conversion fails
-
def
toInstant(sqlTimestamp: Timestamp): Instant
Converts a
java.sql.Timestampto anInstant.Converts a
java.sql.Timestampto anInstant.- sqlTimestamp
the SQL timestamp, not null
- returns
the instant, not null
-
def
toInstant(utilDate: Date): Instant
Converts a
java.util.Dateto anInstant.Converts a
java.util.Dateto anInstant.- utilDate
the util date, not null
- returns
the instant, not null
-
def
toLocalDate(sqlDate: Date): LocalDate
Converts a
java.sql.Dateto aLocalDate.Converts a
java.sql.Dateto aLocalDate.- sqlDate
the SQL date, not null
- returns
the local date, not null
-
def
toLocalDateTime(sqlTimestamp: Timestamp): LocalDateTime
Converts a
java.sql.Timestampto aLocalDateTime.Converts a
java.sql.Timestampto aLocalDateTime.- sqlTimestamp
the SQL timestamp, not null
- returns
the local date-time, not null
-
def
toLocalTime(sqlTime: Time): LocalTime
Converts a
java.sql.Timeto aLocalTime.Converts a
java.sql.Timeto aLocalTime.- sqlTime
the SQL time, not null
- returns
the local time, not null
-
def
toSqlDate(date: LocalDate): Date
Converts a
LocalDateto ajava.sql.Date.Converts a
LocalDateto ajava.sql.Date.- date
the local date, not null
- returns
the SQL date, not null
-
def
toSqlTime(time: LocalTime): Time
Converts a
LocalTimeto ajava.sql.Time.Converts a
LocalTimeto ajava.sql.Time.- time
the local time, not null
- returns
the SQL time, not null
-
def
toSqlTimestamp(instant: Instant): Timestamp
Converts an
Instantto ajava.sql.Timestamp.Converts an
Instantto ajava.sql.Timestamp.- instant
the instant, not null
- returns
the SQL timestamp, not null
-
def
toSqlTimestamp(dateTime: LocalDateTime): Timestamp
Converts a
LocalDateTimeto ajava.sql.Timestamp.Converts a
LocalDateTimeto 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
ZoneIdto aTimeZone.Converts a
ZoneIdto aTimeZone.- zoneId
the zone, not null
- returns
the time-zone, not null
-
def
toZoneId(timeZone: TimeZone): ZoneId
Converts a
TimeZoneto aZoneId.Converts a
TimeZoneto aZoneId.- timeZone
the time-zone, not null
- returns
the zone, not null
-
def
toZonedDateTime(calendar: Calendar): ZonedDateTime
Converts a
Calendarto aZonedDateTime.Converts a
Calendarto aZonedDateTime.Note that
GregorianCalendarsupports a Julian-Gregorian cutover date andZonedDateTimedoes 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( ... )