Package com.atlassian.jira.datetime
Class LocalDateFactory
java.lang.Object
com.atlassian.jira.datetime.LocalDateFactory
Used for creating
LocalDate objects.- Since:
- v4.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDateConstructs a new LocalDate from the givenjava.util.Dateby interpreting the Date in the system (JVM) timezone.static LocalDatefromIsoBasicFormat(String isoDate) Turns an "ISO Basic" formatted date (ie YYYYMMDD) into a LocalDate.static LocalDatefromMillisSinceEpoch(long millisecondsSinceEpoch) Creates a local date based on the number of milliseconds since epoch using a zero offset.static LocalDategetLocalDate(Date date, TimeZone timeZone) Returns the LocalDate for a point in time in a given TimeZone.static StringtoIsoBasic(LocalDate localDate) Formats the given LocalDate in "ISO Basic" format (ie YYYYMMDD).
-
Constructor Details
-
LocalDateFactory
public LocalDateFactory()
-
-
Method Details
-
from
Constructs a new LocalDate from the givenjava.util.Dateby 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.Dateby interpreting the Date in the system (JVM) timezone. (null output for null input)
-
getLocalDate
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 timetimeZone- The TimeZone- Returns:
- the LocalDate for a point in time in a given TimeZone
-
fromMillisSinceEpoch
Creates a local date based on the number of milliseconds since epoch using a zero offset.- Parameters:
millisecondsSinceEpoch- Can be negative- Returns:
- The matching local date
- Since:
- 11.0
-
fromIsoBasicFormat
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
-
toIsoBasic
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)
-