Class DateUtils
java.lang.Object
software.amazon.awssdk.utils.DateUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatIso8601Date
(Instant date) Formats the specified date as an ISO 8601 string.static String
formatRfc1123Date
(Instant instant) Formats the specified date as an RFC 1123 string.static String
formatRfc822Date
(Instant instant) Formats the specified date as an RFC 822 string.static String
formatUnixTimestampInstant
(Instant instant) Formats the giveInstant
object into an Unix timestamp with millisecond decimal precision.static long
numberOfDaysSinceEpoch
(long milliSinceEpoch) Returns the number of days since epoch with respect to the given number of milliseconds since epoch.static Instant
parseIso8601Date
(String dateString) Parses the specified date string as an ISO 8601 date (yyyy-MM-dd'T'HH:mm:ss.SSSZZ) and returns theInstant
object.static Instant
parseRfc1123Date
(String dateString) Parses the specified date string as an RFC 1123 date and returns the Date object.static Instant
parseRfc822Date
(String dateString) Parses the specified date string as an RFC 822 date and returns the Date object.static Instant
parseUnixTimestampInstant
(String dateString) Parses the given string containing a Unix timestamp with millisecond decimal precision into anInstant
object.static Instant
parseUnixTimestampMillisInstant
(String dateString) Parses the given string containing a Unix timestamp in epoch millis into aInstant
object.
-
Method Details
-
parseIso8601Date
-
formatIso8601Date
-
parseRfc822Date
-
formatRfc822Date
-
parseRfc1123Date
-
formatRfc1123Date
-
numberOfDaysSinceEpoch
public static long numberOfDaysSinceEpoch(long milliSinceEpoch) Returns the number of days since epoch with respect to the given number of milliseconds since epoch. -
parseUnixTimestampInstant
Parses the given string containing a Unix timestamp with millisecond decimal precision into anInstant
object.- Throws:
NumberFormatException
-
parseUnixTimestampMillisInstant
public static Instant parseUnixTimestampMillisInstant(String dateString) throws NumberFormatException Parses the given string containing a Unix timestamp in epoch millis into aInstant
object.- Throws:
NumberFormatException
-
formatUnixTimestampInstant
-