public final class DateTimes extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DateTimes.UtcFormatter
Simple wrapper class to enforce UTC Chronology in formatter.
|
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
COMMON_DATE_TIME_PATTERN
This pattern aims to match strings, produced by
AbstractDateTime.toString(). |
static org.joda.time.DateTime |
COMPARE_DATE_AS_STRING_MAX |
static org.joda.time.DateTime |
COMPARE_DATE_AS_STRING_MIN |
static org.joda.time.DateTime |
EPOCH |
static DateTimes.UtcFormatter |
ISO_DATE_OPTIONAL_TIME |
static DateTimes.UtcFormatter |
ISO_DATE_OR_TIME_WITH_OFFSET |
static DateTimes.UtcFormatter |
ISO_DATE_TIME |
static org.joda.time.DateTime |
MAX |
static org.joda.time.DateTime |
MIN |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canCompareAsString(org.joda.time.DateTime dateTime)
Returns true if the provided DateTime can be compared against other DateTimes using its string representation.
|
static org.joda.time.DateTimeZone |
inferTzFromString(String tzId) |
static org.joda.time.DateTimeZone |
inferTzFromString(String tzId,
boolean fallback) |
static org.joda.time.DateTime |
max(org.joda.time.DateTime dt1,
org.joda.time.DateTime dt2) |
static org.joda.time.DateTime |
min(org.joda.time.DateTime dt1,
org.joda.time.DateTime dt2) |
static org.joda.time.DateTime |
nowUtc() |
static org.joda.time.DateTime |
of(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour) |
static org.joda.time.DateTime |
of(String instant) |
static int |
subMonths(long timestamp1,
long timestamp2,
org.joda.time.DateTimeZone timeZone) |
static org.joda.time.DateTime |
utc(long instant) |
static DateTimes.UtcFormatter |
wrapFormatter(org.joda.time.format.DateTimeFormatter formatter)
Creates a
DateTimes.UtcFormatter that wraps around a DateTimeFormatter. |
public static final org.joda.time.DateTime EPOCH
public static final org.joda.time.DateTime MAX
public static final org.joda.time.DateTime MIN
public static final org.joda.time.DateTime COMPARE_DATE_AS_STRING_MIN
public static final org.joda.time.DateTime COMPARE_DATE_AS_STRING_MAX
public static final DateTimes.UtcFormatter ISO_DATE_TIME
public static final DateTimes.UtcFormatter ISO_DATE_OPTIONAL_TIME
public static final DateTimes.UtcFormatter ISO_DATE_OR_TIME_WITH_OFFSET
public static final Pattern COMMON_DATE_TIME_PATTERN
AbstractDateTime.toString(). It's not rigorous: it could accept
some strings that couldn't be obtained by calling toString() on any DateTime object, and also it could
not match some valid DateTime string. Use for heuristic purposes only.public static org.joda.time.DateTimeZone inferTzFromString(String tzId)
public static org.joda.time.DateTimeZone inferTzFromString(String tzId, boolean fallback) throws IllegalArgumentException
IllegalArgumentException - if is false and the provided tzId doesn't match a supported
timezone.public static DateTimes.UtcFormatter wrapFormatter(org.joda.time.format.DateTimeFormatter formatter)
DateTimes.UtcFormatter that wraps around a DateTimeFormatter.formatter - inner DateTimeFormatter used to parse Stringpublic static org.joda.time.DateTime utc(long instant)
public static org.joda.time.DateTime of(String instant)
public static org.joda.time.DateTime of(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour)
public static org.joda.time.DateTime nowUtc()
public static org.joda.time.DateTime max(org.joda.time.DateTime dt1,
org.joda.time.DateTime dt2)
public static org.joda.time.DateTime min(org.joda.time.DateTime dt1,
org.joda.time.DateTime dt2)
public static int subMonths(long timestamp1,
long timestamp2,
org.joda.time.DateTimeZone timeZone)
public static boolean canCompareAsString(org.joda.time.DateTime dateTime)
Intervals.canCompareEndpointsAsStrings(Interval).Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.