com.atlassian.jira.datetime
Class LocalDateFactory

java.lang.Object
  extended by com.atlassian.jira.datetime.LocalDateFactory

public class LocalDateFactory
extends Object

Used for creating LocalDate objects.

Since:
v4.4

Constructor Summary
LocalDateFactory()
           
 
Method Summary
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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalDateFactory

public LocalDateFactory()
Method Detail

from

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)

getLocalDate

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

fromIsoBasicFormat

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

toIsoBasic

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)


Copyright © 2002-2013 Atlassian. All Rights Reserved.