public class LocalDate
extends Object
GDK enhancements for LocalDate.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
format(String pattern)Formats this date with the provided DateTimeFormatter pattern. |
|
public String |
format(FormatStyle dateStyle)Formats this date in the provided, localized FormatStyle. |
|
public String |
getDateString()Formats this date with the DateTimeFormatter.ISO_LOCAL_DATE formatter. |
|
public LocalDateTime |
leftShift(LocalTime time)Returns a LocalDateTime from this date and the provided LocalTime. |
|
public OffsetDateTime |
leftShift(OffsetTime time)Returns a OffsetDateTime from this date and the provided OffsetTime. |
|
public LocalDate |
minus(long days)Returns a LocalDate that is days days before this date. |
|
public long |
minus(LocalDate other)Calculates the number of days between two dates |
|
public LocalDate |
next()Returns a LocalDate one day after this date. |
|
public static LocalDate |
parse(LocalDate type, CharSequence text, String pattern)Parse text into a LocalDate using the provided pattern. |
|
public LocalDate |
plus(long days)Returns a LocalDate that is days days after this date. |
|
public LocalDate |
previous()Returns a LocalDate one day before this date. |
|
public Period |
rightShift(LocalDate other)Returns a Period equivalent to the time between this date (inclusive) and the provided LocalDate (exclusive). |
|
public Calendar |
toCalendar()Returns an equivalent instance of Calendar. |
|
public Date |
toDate()Returns an equivalent instance of Date. |
| Methods inherited from class | Name |
|---|---|
class Object |
addShutdownHook, any, any, asBoolean, asType, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits |
Formats this date with the provided DateTimeFormatter pattern.
pattern - the formatting patternFormats this date in the provided, localized FormatStyle.
dateStyle - the FormatStyleFormats this date with the DateTimeFormatter.ISO_LOCAL_DATE formatter.
Returns a LocalDateTime from this date and the provided LocalTime.
time - a LocalTimeReturns a OffsetDateTime from this date and the provided OffsetTime.
time - an OffsetTime Returns a LocalDate that is days days before this date.
days - the number of days to subtractCalculates the number of days between two dates
other - the other LocalDateReturns a LocalDate one day after this date.
Parse text into a LocalDate using the provided pattern. Note: the order of parameters differs from versions of this method for the legacy Date class.
type - placeholder variable used by Groovy categories; ignored for default static methodstext - String to be parsed to create the date instancepattern - pattern used to parse the text Returns a LocalDate that is days days after this date.
days - the number of days to addReturns a LocalDate one day before this date.
Returns a Period equivalent to the time between this date (inclusive) and the provided LocalDate (exclusive).
other - another LocalDateReturns an equivalent instance of Calendar. The time portion of the returned calendar is cleared and the time zone is the current system default.