public class Dates extends Object
Modifier and Type | Field and Description |
---|---|
static java.time.format.DateTimeFormatter |
ISO_DATE_TIME_FORMATTER
ISO formatter with optional time and zone/offset
|
static java.time.format.DateTimeFormatter |
ISO_ORDINAL_DATE_TIME_FORMATTER
ISO ordinal-date formatter with optional time and zone/offset
|
static java.time.format.DateTimeFormatter |
ISO_WEEK_DATE_FORMATTER
ISO week-date formatter with optional time and zone/offset
|
Modifier and Type | Method and Description |
---|---|
static Date |
toDate(java.time.LocalDate date)
Create an instance of
Date from the LocalDate instance (at start of day). |
static Date |
toDate(java.time.LocalDateTime date)
Create an instance of
Date from the LocalDateTime instance. |
static Date |
toDate(java.time.OffsetDateTime date)
Create an instance of
Date from the ZonedDateTime instance. |
static Date |
toDate(java.time.ZonedDateTime date)
Create an instance of
Date from the ZonedDateTime instance. |
static java.time.LocalDate |
toLocalDate(Date date)
Create an instance of
LocalDate from the Date instance. |
static java.time.LocalDateTime |
toLocalDateTime(Date date)
Create an instance of
LocalDateTime from the Date instance. |
static java.time.ZonedDateTime |
toZonedDateTime(Date date)
Create an instance of
ZonedDateTime from the Date instance. |
public static final java.time.format.DateTimeFormatter ISO_DATE_TIME_FORMATTER
public static final java.time.format.DateTimeFormatter ISO_WEEK_DATE_FORMATTER
public static final java.time.format.DateTimeFormatter ISO_ORDINAL_DATE_TIME_FORMATTER
public static java.time.LocalDate toLocalDate(Date date)
LocalDate
from the Date
instance.date
- LocalDate
public static java.time.LocalDateTime toLocalDateTime(Date date)
LocalDateTime
from the Date
instance.date
- LocalDateTime
public static Date toDate(java.time.LocalDate date)
Date
from the LocalDate
instance (at start of day).date
- Date
public static Date toDate(java.time.LocalDateTime date)
Date
from the LocalDateTime
instance.date
- Date
public static Date toDate(java.time.OffsetDateTime date)
Date
from the ZonedDateTime
instance.date
- Date
public static Date toDate(java.time.ZonedDateTime date)
Date
from the ZonedDateTime
instance.date
- Date
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.