public class Dates extends Object
Unabashedly pinched from Jira
Modifier and Type | Field and Description |
---|---|
static String |
DATE_FORMAT
Deprecated.
since 5.7. This date format will follow that provided by
ISODateTimeFormat.date() |
static String |
TIME_FORMAT
Deprecated.
since 5.7. This date time format will follow that provided by
ISODateTimeFormat.dateTime() |
Modifier and Type | Method and Description |
---|---|
static String |
asDateString(org.joda.time.DateTime date)
Converts the given DateTime object to a String.
|
static String |
asTimeString(org.joda.time.DateTime date)
Converts the given DateTime object to a String.
|
static org.joda.time.DateTime |
fromDateString(String date)
Converts the given date String into a DateTime object.
|
static org.joda.time.DateTime |
fromTimeString(String time)
Converts the given date and time String to a DateTime object.
|
@Deprecated public static final String DATE_FORMAT
ISODateTimeFormat.date()
@Deprecated public static final String TIME_FORMAT
ISODateTimeFormat.dateTime()
public static String asTimeString(org.joda.time.DateTime date)
"yyyy-MM-dd\'T\'HH:mm:ss.SSSZZ"
.date
- a Datepublic static org.joda.time.DateTime fromTimeString(String time) throws IllegalArgumentException
"yyyy-MM-dd\'T\'HH:mm:ss.SSSZZ"
.time
- a String representation of a date and timeRuntimeException
- if there is an error parsing the dateIllegalArgumentException
- if the input string is not in the expected formatpublic static String asDateString(org.joda.time.DateTime date)
"yyyy-MM-dd"
.date
- a Datepublic static org.joda.time.DateTime fromDateString(String date) throws IllegalArgumentException
"yyyy-MM-dd"
.date
- a String containing a dateIllegalArgumentException
- if the input string is not in the expected formatCopyright © 2003–2018 Atlassian. All rights reserved.