public class

LocalDateFactory

extends Object
java.lang.Object
   ↳ com.atlassian.jira.datetime.LocalDateFactory

Class Overview

Used for creating LocalDate objects.

Summary

Public Constructors
LocalDateFactory()
Public Methods
static LocalDate from(Date date)
Constructs a new LocalDate from the given java.util.Date by interpreting the Date in the system (JVM) timezone.
static LocalDate fromIsoBasicFormat(String isoDate)
Turns an "ISO Basic" formatted date (ie YYYYMMDD) into a LocalDate.
static LocalDate getLocalDate(Date date, TimeZone timeZone)
Returns the LocalDate for a point in time in a given TimeZone.
static String toIsoBasic(LocalDate localDate)
Formats the given LocalDate in "ISO Basic" format (ie YYYYMMDD).
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public LocalDateFactory ()

Public Methods

public static LocalDate from (Date date)

Constructs a new LocalDate from the given java.util.Date by interpreting the Date in the system (JVM) timezone.

NB will return null output for null input

Parameters
date the date to convert
Returns
  • a new LocalDate from the given java.util.Date by interpreting the Date in the system (JVM) timezone. (null output for null input)

public static LocalDate fromIsoBasicFormat (String isoDate)

Turns an "ISO Basic" formatted date (ie YYYYMMDD) into a LocalDate.

Parameters
isoDate an "ISO Basic" formatted date
Returns
  • the LocalDate represented by the given ISO format String

public static LocalDate getLocalDate (Date date, TimeZone timeZone)

Returns the LocalDate for a point in time in a given TimeZone.

NB will return null output for null input

Parameters
date The point in time
timeZone The TimeZone
Returns
  • the LocalDate for a point in time in a given TimeZone

public static String toIsoBasic (LocalDate localDate)

Formats the given LocalDate in "ISO Basic" format (ie YYYYMMDD).

Parameters
localDate the date to format.
Returns
  • the "ISO Basic" format (or null for null input)