public final class DateTimeUtils extends Object
Modifier and Type | Method and Description |
---|---|
static int |
parseDate(String value) |
static long |
parseDayTimeInterval(String value,
IntervalLiteral.IntervalField startField,
Optional<IntervalLiteral.IntervalField> endField) |
static long |
parsePeriodMillis(org.joda.time.format.PeriodFormatter periodFormatter,
String value,
IntervalLiteral.IntervalField startField,
IntervalLiteral.IntervalField endField) |
static long |
parseTimeLiteral(String value)
Parse a string (optionally containing a zone) as a value of either TIME or TIME WITH TIME ZONE type.
|
static long |
parseTimeLiteral(TimeZoneKey timeZoneKey,
String value)
Deprecated.
|
static long |
parseTimestampLiteral(String value)
Parse a string (optionally containing a zone) as a value of either TIMESTAMP or TIMESTAMP WITH TIME ZONE type.
|
static long |
parseTimestampLiteral(TimeZoneKey timeZoneKey,
String value)
Deprecated.
|
static long |
parseTimestampWithoutTimeZone(String value)
Parse a string (optionally containing a zone) as a value of TIMESTAMP type.
|
static long |
parseTimestampWithoutTimeZone(TimeZoneKey timeZoneKey,
String value)
Deprecated.
|
static long |
parseTimestampWithTimeZone(TimeZoneKey timeZoneKey,
String timestampWithTimeZone)
Parse a string (optionally containing a zone) as a value of TIMESTAMP WITH TIME ZONE type.
|
static long |
parseTimeWithoutTimeZone(String value)
Parse a string (without a zone) as a value of TIME type.
|
static long |
parseTimeWithoutTimeZone(TimeZoneKey timeZoneKey,
String value)
Deprecated.
|
static long |
parseTimeWithTimeZone(String timeWithTimeZone)
Parse a string containing a zone as a value of TIME WITH TIME ZONE type.
|
static long |
parseYearMonthInterval(String value,
IntervalLiteral.IntervalField startField,
Optional<IntervalLiteral.IntervalField> endField) |
static String |
printDate(int days) |
static String |
printTimestampWithoutTimeZone(long timestamp) |
static String |
printTimestampWithoutTimeZone(TimeZoneKey timeZoneKey,
long timestamp)
Deprecated.
|
static String |
printTimestampWithTimeZone(long timestampWithTimeZone) |
static String |
printTimeWithoutTimeZone(long value) |
static String |
printTimeWithoutTimeZone(TimeZoneKey timeZoneKey,
long value)
Deprecated.
|
static String |
printTimeWithTimeZone(long timeWithTimeZone) |
static boolean |
timeHasTimeZone(String value) |
static boolean |
timestampHasTimeZone(String value) |
public static int parseDate(String value)
public static String printDate(int days)
public static long parseTimestampLiteral(String value)
For example: "2000-01-01 01:23:00"
is parsed to TIMESTAMP 2000-01-01T01:23:00
and "2000-01-01 01:23:00 +01:23"
is parsed to TIMESTAMP WITH TIME ZONE
2000-01-01T01:23:00.000+01:23
.
@Deprecated public static long parseTimestampLiteral(TimeZoneKey timeZoneKey, String value)
timeZoneKey
zone.public static long parseTimestampWithTimeZone(TimeZoneKey timeZoneKey, String timestampWithTimeZone)
timeZoneKey
zone.
For example: "2000-01-01 01:23:00"
is parsed to TIMESTAMP WITH TIME ZONE
2000-01-01T01:23:00 <provided zone>
and "2000-01-01 01:23:00 +01:23"
is parsed to TIMESTAMP WITH TIME ZONE 2000-01-01T01:23:00.000+01:23
.
public static long parseTimestampWithoutTimeZone(String value)
For example: "2000-01-01 01:23:00"
is parsed to TIMESTAMP 2000-01-01T01:23:00
and "2000-01-01 01:23:00 +01:23"
is also parsed to TIMESTAMP 2000-01-01T01:23:00.000
.
@Deprecated public static long parseTimestampWithoutTimeZone(TimeZoneKey timeZoneKey, String value)
timeZoneKey
zone.public static String printTimestampWithTimeZone(long timestampWithTimeZone)
public static String printTimestampWithoutTimeZone(long timestamp)
@Deprecated public static String printTimestampWithoutTimeZone(TimeZoneKey timeZoneKey, long timestamp)
public static boolean timestampHasTimeZone(String value)
public static long parseTimeLiteral(String value)
For example: "01:23:00"
is parsed to TIME 01:23:00
and "01:23:00 +01:23"
is parsed to TIME WITH TIME ZONE
01:23:00+01:23
.
@Deprecated public static long parseTimeLiteral(TimeZoneKey timeZoneKey, String value)
timeZoneKey
zone.public static long parseTimeWithTimeZone(String timeWithTimeZone)
For example: "01:23:00 +01:23"
is parsed to TIME WITH TIME ZONE
01:23:00+01:23
and "01:23:00"
is rejected.
public static long parseTimeWithoutTimeZone(String value)
For example: "01:23:00"
is parsed to TIME 01:23:00
and "01:23:00 +01:23"
is rejected.
@Deprecated public static long parseTimeWithoutTimeZone(TimeZoneKey timeZoneKey, String value)
timeZoneKey
zone.public static String printTimeWithTimeZone(long timeWithTimeZone)
public static String printTimeWithoutTimeZone(long value)
@Deprecated public static String printTimeWithoutTimeZone(TimeZoneKey timeZoneKey, long value)
public static boolean timeHasTimeZone(String value)
public static long parseDayTimeInterval(String value, IntervalLiteral.IntervalField startField, Optional<IntervalLiteral.IntervalField> endField)
public static long parsePeriodMillis(org.joda.time.format.PeriodFormatter periodFormatter, String value, IntervalLiteral.IntervalField startField, IntervalLiteral.IntervalField endField)
public static long parseYearMonthInterval(String value, IntervalLiteral.IntervalField startField, Optional<IntervalLiteral.IntervalField> endField)
Copyright © 2012–2022. All rights reserved.