public class DateUtils
extends java.lang.Object
This class offers functionality for:
Example usage:
// Parse a date string
Date date = DateUtils.parseDate("2023-12-25 10:30:45");
// Format a Date object
String formatted = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
// Parse with specific format and time zone
Date date2 = DateUtils.parseDate("2023/12/25 10:30:45", "yyyy/MM/dd HH:mm:ss", ZoneId.of("UTC"));
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
DateUtils.CacheDate10 |
(package private) static class |
DateUtils.CacheDate8 |
static class |
DateUtils.DateTimeFormatPattern |
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.time.format.DateTimeFormatter |
DATE_TIME_FORMATTER_34 |
(package private) static java.time.format.DateTimeFormatter |
DATE_TIME_FORMATTER_COOKIE |
(package private) static java.time.format.DateTimeFormatter |
DATE_TIME_FORMATTER_COOKIE_LOCAL |
(package private) static java.time.format.DateTimeFormatter |
DATE_TIME_FORMATTER_RFC_2822 |
static java.time.ZoneId |
DEFAULT_ZONE_ID |
static java.time.LocalDate |
LOCAL_DATE_19700101 |
(package private) static int |
LOCAL_EPOCH_DAY |
static java.time.ZoneId |
OFFSET_8_ZONE_ID |
static java.lang.String |
OFFSET_8_ZONE_ID_NAME |
private static int[] |
POWERS |
static java.time.ZoneId |
SHANGHAI_ZONE_ID |
static java.lang.String |
SHANGHAI_ZONE_ID_NAME |
static java.time.zone.ZoneRules |
SHANGHAI_ZONE_RULES |
| Constructor and Description |
|---|
DateUtils() |
| Modifier and Type | Method and Description |
|---|---|
private static long |
calcEpochDay(int year,
int month,
int dom) |
static java.lang.String |
format(java.util.Date date) |
static java.lang.String |
format(java.util.Date date,
java.lang.String format) |
static java.lang.String |
format(int year,
int month,
int dayOfMonth) |
static java.lang.String |
format(int year,
int month,
int dayOfMonth,
DateUtils.DateTimeFormatPattern pattern) |
static java.lang.String |
format(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second) |
(package private) static java.lang.String |
format(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
DateUtils.DateTimeFormatPattern pattern) |
static java.lang.String |
format(java.time.LocalDate localDate,
java.lang.String format) |
static java.lang.String |
format(java.time.LocalDateTime ldt,
java.lang.String format) |
static java.lang.String |
format(long timeMillis) |
static java.lang.String |
format(long timeMillis,
DateUtils.DateTimeFormatPattern pattern) |
static java.lang.String |
format(java.time.ZonedDateTime zdt,
java.lang.String format) |
static java.lang.String |
formatYMD10(java.util.Date date) |
static java.lang.String |
formatYMD10(int year,
int month,
int dayOfMonth) |
static java.lang.String |
formatYMD10(java.time.LocalDate date) |
static java.lang.String |
formatYMD10(long timeMillis,
java.time.ZoneId zoneId) |
static java.lang.String |
formatYMD8(java.util.Date date)
Formats a Date object to a string in the format "yyyyMMdd".
|
static java.lang.String |
formatYMD8(java.time.LocalDate date) |
static java.lang.String |
formatYMD8(long timeMillis,
java.time.ZoneId zoneId)
Formats a timestamp in milliseconds to a string in the format "yyyyMMdd".
|
static java.lang.String |
formatYMDHMS19(java.util.Date date)
Formats a Date object to a string in the format "yyyy-MM-dd HH:mm:ss".
|
static java.lang.String |
formatYMDHMS19(java.util.Date date,
java.time.ZoneId zoneId)
Formats a Date object to a string in the format "yyyy-MM-dd HH:mm:ss".
|
static java.lang.String |
formatYMDHMS19(java.time.LocalDate localDate) |
static java.lang.String |
formatYMDHMS19(java.time.LocalDateTime ldt) |
static java.lang.String |
formatYMDHMS19(java.time.ZonedDateTime zdt) |
static int |
getShanghaiZoneOffsetTotalSeconds(long seconds) |
static java.time.ZoneId |
getZoneId(java.lang.String zoneIdStr,
java.time.ZoneId defaultZoneId) |
static long |
hms(byte[] bytes,
int off) |
static int |
hourAfterNoon(char h0,
char h1) |
static boolean |
isDate(java.lang.String str) |
static boolean |
isLocalDate(java.lang.String str) |
static boolean |
isLocalTime(java.lang.String str) |
static java.time.LocalDateTime |
localDateTime(char y0,
char y1,
char y2,
char y3,
char m0,
char m1,
char d0,
char d1,
char h0,
char h1,
char i0,
char i1,
char s0,
char s1) |
static java.time.LocalDateTime |
localDateTime(char y0,
char y1,
char y2,
char y3,
char m0,
char m1,
char d0,
char d1,
char h0,
char h1,
char i0,
char i1,
char s0,
char s1,
char S0,
char S1,
char S2,
char S3,
char S4,
char S5,
char S6,
char S7,
char S8) |
static java.time.LocalDate |
localDateYMD(byte[] bytes,
int off) |
private static java.time.LocalTime |
localTime(int hour,
int minute,
int second) |
static long |
millis(java.time.LocalDateTime ldt) |
static long |
millis(java.time.LocalDateTime ldt,
java.time.ZoneId zoneId) |
static long |
millis(java.time.ZoneId zoneId,
int year,
int month,
int dom,
int hour,
int minute,
int second,
int nanoOfSecond) |
private static int |
month(byte c0,
byte c1,
byte c2) |
static int |
month(char c0,
char c1,
char c2) |
static int |
nanos(int value,
int nanoSize) |
static java.util.Date |
parseDate(java.lang.String str)
Parses a date string to a Date object using default parsing rules.
|
static java.util.Date |
parseDate(java.lang.String str,
java.lang.String format)
Parses a date string with the specified format to a Date object.
|
static java.util.Date |
parseDate(java.lang.String str,
java.lang.String format,
java.time.ZoneId zoneId)
Parses a date string with the specified format and time zone to a Date object.
|
static java.util.Date |
parseDate(java.lang.String str,
java.time.ZoneId zoneId)
Parses a date string to a Date object using default parsing rules.
|
static java.util.Date |
parseDateYMDHMS19(java.lang.String str)
Parses a date string in the format "yyyy-MM-dd HH:mm:ss" to a Date object.
|
static java.time.LocalDate |
parseLocalDate(byte[] str,
int off,
int len) |
static java.time.LocalDate |
parseLocalDate(char[] str,
int off,
int len)
Parses a character array to a LocalDate object using default parsing rules
with specified offset and length.
|
static java.time.LocalDate |
parseLocalDate(java.lang.String str) |
static java.time.LocalDate |
parseLocalDate10(byte[] str,
int off)
yyyy-MM-dd
yyyy/MM/dd
MM/dd/yyyy
dd.MM.yyyy
yyyy年M月dd日
yyyy年MM月d日
yyyy MMM d
|
static java.time.LocalDate |
parseLocalDate10(char[] str,
int off)
yyyy-MM-dd
yyyy/MM/dd
MM/dd/yyyy
dd.MM.yyyy
yyyy年M月dd日
yyyy年MM月d日
yyyy MMM d
|
static java.time.LocalDate |
parseLocalDate11(byte[] str,
int off) |
static java.time.LocalDate |
parseLocalDate11(char[] str,
int off)
yyyy年MM月dd日
yyyy년MM월dd일
|
static java.time.LocalDate |
parseLocalDate8(byte[] str,
int off)
yyyy-m-d
yyyyMMdd
d-MMM-yy
|
static java.time.LocalDate |
parseLocalDate8(char[] str,
int off)
yyyy-m-d
yyyyMMdd
d-MMM-yy
|
static java.time.LocalDate |
parseLocalDate9(byte[] str,
int off)
yyyy-MM-d
yyyy-M-dd
dd-MMM-yy
|
static java.time.LocalDate |
parseLocalDate9(char[] str,
int off)
yyyy-MM-d
yyyy-M-dd
dd-MMM-yy
|
static java.time.LocalDateTime |
parseLocalDateTime(byte[] str,
int off,
int len) |
static java.time.LocalDateTime |
parseLocalDateTime(char[] str,
int off,
int len)
Parses a character array to a LocalDateTime object using default parsing rules
with specified offset and length.
|
static java.time.LocalDateTime |
parseLocalDateTime(java.lang.String str)
Parses a date string to a LocalDateTime object using default parsing rules.
|
static java.time.LocalDateTime |
parseLocalDateTime(java.lang.String str,
int off,
int len)
Parses a date string to a LocalDateTime object using default parsing rules
with specified offset and length.
|
static java.time.LocalDateTime |
parseLocalDateTime12(byte[] str,
int off)
parseLocalDateTime use format 'yyyyMMddHHmm'
|
static java.time.LocalDateTime |
parseLocalDateTime12(char[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime14(byte[] str,
int off)
yyyyMMddHHmmss
|
static java.time.LocalDateTime |
parseLocalDateTime14(char[] str,
int off)
yyyyMMddHHmmss
|
static java.time.LocalDateTime |
parseLocalDateTime16(byte[] str,
int off)
yyyy-MM-ddTHH:mm
yyyy-MM-dd HH:mm
yyyyMMddTHHmmssZ
yyyy-MM-ddTH:m:s
yyyy-MM-dd H:m:s
|
static java.time.LocalDateTime |
parseLocalDateTime16(char[] str,
int off)
yyyy-MM-ddTHH:mm
yyyy-MM-dd HH:mm
yyyyMMddTHHmmssZ
yyyy-MM-ddTH:m:s
yyyy-MM-dd H:m:s
|
static java.time.LocalDateTime |
parseLocalDateTime17(byte[] str,
int off)
yyyy-MM-ddTHH:mmZ
yyyy-MM-dd HH:mmZ
yyyy-M-dTHH:mm:ss
yyyy-M-d HH:mm:ss
|
static java.time.LocalDateTime |
parseLocalDateTime17(char[] str,
int off)
yyyy-MM-ddTHH:mmZ
yyyy-MM-dd HH:mmZ
yyyy-M-dTHH:mm:ss
yyyy-M-d HH:mm:ss
|
static java.time.LocalDateTime |
parseLocalDateTime18(byte[] str,
int off)
yyyy-M-ddTHH:mm:ss
yyyy-M-dd HH:mm:ss
yyyy-MM-dTHH:mm:ss
yyyy-MM-d HH:mm:ss
yyyy-MM-ddTH:mm:ss
yyyy-MM-dd H:mm:ss
yyyy-MM-ddTHH:m:ss
yyyy-MM-dd HH:m:ss
yyyy-MM-ddTHH:mm:s
yyyy-MM-dd HH:mm:s
|
static java.time.LocalDateTime |
parseLocalDateTime18(char[] str,
int off)
yyyy-M-ddTHH:mm:ss
yyyy-M-dd HH:mm:ss
yyyy-MM-dTHH:mm:ss
yyyy-MM-d HH:mm:ss
yyyy-MM-ddTH:mm:ss
yyyy-MM-dd H:mm:ss
yyyy-MM-ddTHH:m:ss
yyyy-MM-dd HH:m:ss
yyyy-MM-ddTHH:mm:s
yyyy-MM-dd HH:mm:s
|
static java.time.LocalDateTime |
parseLocalDateTime19(byte[] str,
int off)
yyyy-MM-ddTHH:mm:ss
yyyy-MM-dd HH:mm:ss
yyyy/MM/ddTHH:mm:ss
yyyy/MM/dd HH:mm:ss
|
static java.time.LocalDateTime |
parseLocalDateTime19(char[] str,
int off)
yyyy-MM-ddTHH:mm:ss
yyyy-MM-dd HH:mm:ss
yyyy/MM/ddTHH:mm:ss
yyyy/MM/dd HH:mm:ss
|
static java.time.LocalDateTime |
parseLocalDateTime19(java.lang.String str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime20(byte[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime20(char[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime26(byte[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime26(char[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime27(byte[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime27(char[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime28(byte[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime28(char[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime29(byte[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTime29(char[] str,
int off) |
static java.time.LocalDateTime |
parseLocalDateTimeX(byte[] str,
int offset,
int len) |
static java.time.LocalDateTime |
parseLocalDateTimeX(char[] str,
int offset,
int len) |
static java.time.LocalTime |
parseLocalTime(char c0,
char c1,
char c2,
char c3,
char c4,
char c5,
char c6,
char c7) |
static java.time.LocalTime |
parseLocalTime10(byte[] str,
int off) |
static java.time.LocalTime |
parseLocalTime10(char[] str,
int off) |
static java.time.LocalTime |
parseLocalTime11(byte[] str,
int off) |
static java.time.LocalTime |
parseLocalTime11(char[] str,
int off) |
static java.time.LocalTime |
parseLocalTime12(byte[] str,
int off) |
static java.time.LocalTime |
parseLocalTime12(char[] str,
int off) |
static java.time.LocalTime |
parseLocalTime15(byte[] str,
int off) |
static java.time.LocalTime |
parseLocalTime15(char[] str,
int off) |
static java.time.LocalTime |
parseLocalTime18(byte[] str,
int off) |
static java.time.LocalTime |
parseLocalTime18(char[] str,
int off) |
static java.time.LocalTime |
parseLocalTime5(byte[] str,
int off)
Parses a byte array to a LocalTime object with 5-character format (HH:mm).
|
static java.time.LocalTime |
parseLocalTime5(char[] str,
int off)
Parses a character array to a LocalTime object with 5-character format (HH:mm).
|
static java.time.LocalTime |
parseLocalTime6(byte[] str,
int off)
Parses a byte array to a LocalTime object with 6-character format (HHmmss).
|
static java.time.LocalTime |
parseLocalTime6(char[] str,
int off)
Parses a character array to a LocalTime object with 6-character format (HHmmss).
|
static java.time.LocalTime |
parseLocalTime7(byte[] str,
int off) |
static java.time.LocalTime |
parseLocalTime7(char[] str,
int off) |
static java.time.LocalTime |
parseLocalTime8(byte[] bytes,
int off) |
static java.time.LocalTime |
parseLocalTime8(char[] bytes,
int off) |
static long |
parseMillis(byte[] bytes,
int off,
int len) |
static long |
parseMillis(byte[] bytes,
int off,
int len,
java.nio.charset.Charset charset) |
static long |
parseMillis(byte[] chars,
int off,
int len,
java.nio.charset.Charset charset,
java.time.ZoneId zoneId) |
static long |
parseMillis(char[] bytes,
int off,
int len) |
static long |
parseMillis(char[] chars,
int off,
int len,
java.time.ZoneId zoneId) |
static long |
parseMillis(java.lang.String str)
Parses a date string to milliseconds since epoch using default parsing rules.
|
static long |
parseMillis(java.lang.String str,
java.time.ZoneId zoneId)
Parses a date string to milliseconds since epoch using default parsing rules.
|
(package private) static long |
parseMillis10(java.lang.String str,
java.time.ZoneId zoneId,
DateUtils.DateTimeFormatPattern pattern) |
static long |
parseMillis19(byte[] bytes,
int off,
java.time.ZoneId zoneId) |
static long |
parseMillis19(char[] bytes,
int off,
java.time.ZoneId zoneId) |
static long |
parseMillis19(java.lang.String str,
java.time.ZoneId zoneId) |
(package private) static long |
parseMillis19(java.lang.String str,
java.time.ZoneId zoneId,
DateUtils.DateTimeFormatPattern pattern) |
static long |
parseMillisYMDHMS19(java.lang.String str,
java.time.ZoneId zoneId) |
static java.time.ZonedDateTime |
parseZonedDateTime(byte[] str,
int off,
int len) |
static java.time.ZonedDateTime |
parseZonedDateTime(byte[] str,
int off,
int len,
java.time.ZoneId defaultZoneId) |
static java.time.ZonedDateTime |
parseZonedDateTime(char[] str,
int off,
int len)
Parses a character array to a ZonedDateTime object using default parsing rules
with specified offset and length.
|
static java.time.ZonedDateTime |
parseZonedDateTime(char[] str,
int off,
int len,
java.time.ZoneId defaultZoneId) |
static java.time.ZonedDateTime |
parseZonedDateTime(java.lang.String str) |
static java.time.ZonedDateTime |
parseZonedDateTime(java.lang.String str,
java.time.ZoneId defaultZoneId) |
(package private) static java.time.ZonedDateTime |
parseZonedDateTime16(byte[] str,
int off,
java.time.ZoneId defaultZonedId)
ISO Date with offset, example '2011-12-03+01:00'
|
(package private) static java.time.ZonedDateTime |
parseZonedDateTime16(char[] str,
int off,
java.time.ZoneId defaultZonedId)
ISO Date with offset, example '2011-12-03+01:00'
|
(package private) static java.time.ZonedDateTime |
parseZonedDateTimeCookie(java.lang.String str) |
static int |
readNanos(byte[] bytes,
int len,
int offset) |
static int |
readNanos(char[] chars,
int len,
int offset) |
static java.lang.String |
toString(java.util.Date date) |
static java.lang.String |
toString(long timeMillis,
boolean timeZone,
java.time.ZoneId zoneId) |
static long |
utcSeconds(int year,
int month,
int dom,
int hour,
int minute,
int second) |
static int |
yy(byte[] bytes,
int off) |
static java.time.ZoneOffset |
zoneOffset(byte[] bytes,
int start,
int len) |
static java.time.ZoneOffset |
zoneOffset(char[] bytes,
int start,
int len) |
public static final java.time.ZoneId DEFAULT_ZONE_ID
public static final java.lang.String SHANGHAI_ZONE_ID_NAME
public static final java.time.ZoneId SHANGHAI_ZONE_ID
public static final java.time.zone.ZoneRules SHANGHAI_ZONE_RULES
public static final java.lang.String OFFSET_8_ZONE_ID_NAME
public static final java.time.ZoneId OFFSET_8_ZONE_ID
public static final java.time.LocalDate LOCAL_DATE_19700101
static java.time.format.DateTimeFormatter DATE_TIME_FORMATTER_34
static java.time.format.DateTimeFormatter DATE_TIME_FORMATTER_COOKIE
static java.time.format.DateTimeFormatter DATE_TIME_FORMATTER_COOKIE_LOCAL
static java.time.format.DateTimeFormatter DATE_TIME_FORMATTER_RFC_2822
static final int LOCAL_EPOCH_DAY
private static final int[] POWERS
public static java.util.Date parseDateYMDHMS19(java.lang.String str)
str - the date string to parse, e.g., "2023-12-25 10:30:45"public static java.util.Date parseDate(java.lang.String str,
java.lang.String format)
str - the date string to parseformat - the format pattern to use for parsingpublic static java.util.Date parseDate(java.lang.String str,
java.lang.String format,
java.time.ZoneId zoneId)
str - the date string to parseformat - the format pattern to use for parsingzoneId - the time zone to use for parsingpublic static java.util.Date parseDate(java.lang.String str)
str - the date string to parsepublic static java.util.Date parseDate(java.lang.String str,
java.time.ZoneId zoneId)
str - the date string to parsezoneId - the time zone to use for parsingpublic static long parseMillis(java.lang.String str)
str - the date string to parsepublic static long parseMillis(java.lang.String str,
java.time.ZoneId zoneId)
str - the date string to parsezoneId - the time zone to use for parsingpublic static java.time.LocalDateTime parseLocalDateTime(java.lang.String str)
str - the date string to parsepublic static java.time.LocalDateTime parseLocalDateTime(java.lang.String str,
int off,
int len)
str - the date string to parseoff - the offset in the string to start parsing fromlen - the length of the substring to parsepublic static java.time.LocalDateTime parseLocalDateTime(char[] str,
int off,
int len)
str - the character array to parseoff - the offset in the array to start parsing fromlen - the length of the subarray to parsepublic static java.time.LocalTime parseLocalTime5(byte[] str,
int off)
str - the byte array to parseoff - the offset in the array to start parsing frompublic static java.time.LocalTime parseLocalTime5(char[] str,
int off)
str - the character array to parseoff - the offset in the array to start parsing frompublic static java.time.LocalTime parseLocalTime6(byte[] str,
int off)
str - the byte array to parseoff - the offset in the array to start parsing frompublic static java.time.LocalTime parseLocalTime6(char[] str,
int off)
str - the character array to parseoff - the offset in the array to start parsing frompublic static java.time.LocalTime parseLocalTime7(byte[] str,
int off)
public static java.time.LocalTime parseLocalTime7(char[] str,
int off)
public static java.time.LocalTime parseLocalTime8(byte[] bytes,
int off)
public static java.time.LocalTime parseLocalTime8(char[] bytes,
int off)
public static java.time.LocalTime parseLocalTime(char c0,
char c1,
char c2,
char c3,
char c4,
char c5,
char c6,
char c7)
public static java.time.LocalTime parseLocalTime10(byte[] str,
int off)
public static java.time.LocalTime parseLocalTime10(char[] str,
int off)
public static java.time.LocalTime parseLocalTime11(byte[] str,
int off)
public static java.time.LocalTime parseLocalTime11(char[] str,
int off)
public static java.time.LocalTime parseLocalTime12(byte[] str,
int off)
public static java.time.LocalTime parseLocalTime12(char[] str,
int off)
public static java.time.LocalTime parseLocalTime15(byte[] str,
int off)
public static java.time.LocalTime parseLocalTime15(char[] str,
int off)
public static java.time.LocalTime parseLocalTime18(byte[] str,
int off)
public static java.time.LocalTime parseLocalTime18(char[] str,
int off)
private static java.time.LocalTime localTime(int hour,
int minute,
int second)
public static java.time.LocalDateTime parseLocalDateTime(byte[] str,
int off,
int len)
public static java.time.LocalDate parseLocalDate(java.lang.String str)
public static java.time.LocalDate parseLocalDate(byte[] str,
int off,
int len)
public static java.time.LocalDate parseLocalDate(char[] str,
int off,
int len)
str - the character array to parseoff - the offset in the array to start parsing fromlen - the length of the subarray to parsepublic static long parseMillis(byte[] bytes,
int off,
int len)
public static long parseMillis(byte[] bytes,
int off,
int len,
java.nio.charset.Charset charset)
public static long parseMillis(byte[] chars,
int off,
int len,
java.nio.charset.Charset charset,
java.time.ZoneId zoneId)
public static long parseMillis(char[] bytes,
int off,
int len)
public static long parseMillis(char[] chars,
int off,
int len,
java.time.ZoneId zoneId)
public static java.time.LocalDate parseLocalDate8(byte[] str,
int off)
public static java.time.LocalDate parseLocalDate8(char[] str,
int off)
public static java.time.LocalDate parseLocalDate9(byte[] str,
int off)
public static java.time.LocalDate parseLocalDate9(char[] str,
int off)
public static java.time.LocalDate parseLocalDate10(byte[] str,
int off)
public static java.time.LocalDate parseLocalDate10(char[] str,
int off)
public static java.time.LocalDate parseLocalDate11(char[] str,
int off)
public static java.time.LocalDate parseLocalDate11(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime12(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime12(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime14(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime14(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime16(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime16(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime17(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime17(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime18(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime18(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime19(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime19(java.lang.String str,
int off)
public static java.time.LocalDateTime parseLocalDateTime19(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime20(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime20(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime26(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime26(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime27(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime27(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime28(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime28(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime29(byte[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTime29(char[] str,
int off)
public static java.time.LocalDateTime parseLocalDateTimeX(char[] str,
int offset,
int len)
public static java.time.LocalDateTime parseLocalDateTimeX(byte[] str,
int offset,
int len)
static java.time.ZonedDateTime parseZonedDateTime16(char[] str,
int off,
java.time.ZoneId defaultZonedId)
static java.time.ZonedDateTime parseZonedDateTime16(byte[] str,
int off,
java.time.ZoneId defaultZonedId)
public static java.time.ZonedDateTime parseZonedDateTime(java.lang.String str)
public static java.time.ZonedDateTime parseZonedDateTime(java.lang.String str,
java.time.ZoneId defaultZoneId)
public static java.time.ZonedDateTime parseZonedDateTime(byte[] str,
int off,
int len)
public static java.time.ZonedDateTime parseZonedDateTime(char[] str,
int off,
int len)
str - the character array to parseoff - the offset in the array to start parsing fromlen - the length of the subarray to parsepublic static java.time.ZonedDateTime parseZonedDateTime(byte[] str,
int off,
int len,
java.time.ZoneId defaultZoneId)
public static java.time.ZonedDateTime parseZonedDateTime(char[] str,
int off,
int len,
java.time.ZoneId defaultZoneId)
static java.time.ZonedDateTime parseZonedDateTimeCookie(java.lang.String str)
public static java.time.ZoneId getZoneId(java.lang.String zoneIdStr,
java.time.ZoneId defaultZoneId)
public static long parseMillisYMDHMS19(java.lang.String str,
java.time.ZoneId zoneId)
private static long calcEpochDay(int year,
int month,
int dom)
static long parseMillis19(java.lang.String str,
java.time.ZoneId zoneId,
DateUtils.DateTimeFormatPattern pattern)
static long parseMillis10(java.lang.String str,
java.time.ZoneId zoneId,
DateUtils.DateTimeFormatPattern pattern)
public static long parseMillis19(java.lang.String str,
java.time.ZoneId zoneId)
public static long parseMillis19(byte[] bytes,
int off,
java.time.ZoneId zoneId)
public static long parseMillis19(char[] bytes,
int off,
java.time.ZoneId zoneId)
public static java.time.LocalDateTime localDateTime(char y0,
char y1,
char y2,
char y3,
char m0,
char m1,
char d0,
char d1,
char h0,
char h1,
char i0,
char i1,
char s0,
char s1)
public static java.time.LocalDateTime localDateTime(char y0,
char y1,
char y2,
char y3,
char m0,
char m1,
char d0,
char d1,
char h0,
char h1,
char i0,
char i1,
char s0,
char s1,
char S0,
char S1,
char S2,
char S3,
char S4,
char S5,
char S6,
char S7,
char S8)
public static long millis(java.time.LocalDateTime ldt)
public static long millis(java.time.LocalDateTime ldt,
java.time.ZoneId zoneId)
public static long millis(java.time.ZoneId zoneId,
int year,
int month,
int dom,
int hour,
int minute,
int second,
int nanoOfSecond)
public static long utcSeconds(int year,
int month,
int dom,
int hour,
int minute,
int second)
public static java.lang.String formatYMDHMS19(java.util.Date date)
date - the Date object to formatpublic static java.lang.String formatYMDHMS19(java.util.Date date,
java.time.ZoneId zoneId)
date - the Date object to formatzoneId - the time zone to use for formattingpublic static java.lang.String formatYMD8(java.util.Date date)
date - the Date object to formatpublic static java.lang.String formatYMD8(long timeMillis,
java.time.ZoneId zoneId)
timeMillis - the timestamp in milliseconds to formatzoneId - the time zone to use for formattingpublic static java.lang.String formatYMD10(int year,
int month,
int dayOfMonth)
public static java.lang.String formatYMD10(java.time.LocalDate date)
public static java.lang.String formatYMD10(java.util.Date date)
public static java.lang.String formatYMD8(java.time.LocalDate date)
public static java.lang.String formatYMD10(long timeMillis,
java.time.ZoneId zoneId)
public static java.lang.String format(java.util.Date date,
java.lang.String format)
public static java.lang.String formatYMDHMS19(java.time.ZonedDateTime zdt)
public static java.lang.String format(java.time.ZonedDateTime zdt,
java.lang.String format)
public static java.lang.String formatYMDHMS19(java.time.LocalDateTime ldt)
public static java.lang.String format(java.time.LocalDateTime ldt,
java.lang.String format)
public static java.lang.String formatYMDHMS19(java.time.LocalDate localDate)
public static java.lang.String format(java.time.LocalDate localDate,
java.lang.String format)
public static java.lang.String format(int year,
int month,
int dayOfMonth)
public static java.lang.String format(int year,
int month,
int dayOfMonth,
DateUtils.DateTimeFormatPattern pattern)
public static java.lang.String format(long timeMillis)
public static java.lang.String format(java.util.Date date)
public static java.lang.String format(long timeMillis,
DateUtils.DateTimeFormatPattern pattern)
public static java.lang.String format(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second)
static java.lang.String format(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
DateUtils.DateTimeFormatPattern pattern)
public static java.lang.String toString(java.util.Date date)
public static java.lang.String toString(long timeMillis,
boolean timeZone,
java.time.ZoneId zoneId)
private static int month(byte c0,
byte c1,
byte c2)
public static int month(char c0,
char c1,
char c2)
public static int hourAfterNoon(char h0,
char h1)
public static int getShanghaiZoneOffsetTotalSeconds(long seconds)
public static boolean isLocalDate(java.lang.String str)
public static boolean isDate(java.lang.String str)
public static boolean isLocalTime(java.lang.String str)
public static int readNanos(char[] chars,
int len,
int offset)
public static int readNanos(byte[] bytes,
int len,
int offset)
public static java.time.ZoneOffset zoneOffset(byte[] bytes,
int start,
int len)
public static java.time.ZoneOffset zoneOffset(char[] bytes,
int start,
int len)
public static int nanos(int value,
int nanoSize)
public static long hms(byte[] bytes,
int off)
public static int yy(byte[] bytes,
int off)
public static java.time.LocalDate localDateYMD(byte[] bytes,
int off)