Class DateUtils
- java.lang.Object
-
- no.digipost.api.useragreements.client.util.DateUtils
-
public class DateUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description DateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringformatDate(ZonedDateTime dateTime)Format aZonedDateTimeas RFC 1123 date format used in HTTP.static ZonedDateTimeparseDate(String dateTime)Return anZonedDateTimeparsed from an RFC 1123 compliant string, i.e.
-
-
-
Field Detail
-
GMT
public static final ZoneId GMT
-
-
Method Detail
-
formatDate
public static String formatDate(ZonedDateTime dateTime)
Format aZonedDateTimeas RFC 1123 date format used in HTTP. The format isDateTimeFormatter.RFC_1123_DATE_TIME.- Parameters:
dateTime- TheZonedDateTimeto format.- Returns:
- the dateTime formatted as RFC 1123 compliant string
-
parseDate
public static ZonedDateTime parseDate(String dateTime)
Return anZonedDateTimeparsed from an RFC 1123 compliant string, i.e. having the formatDateTimeFormatter.RFC_1123_DATE_TIME.- Parameters:
dateTime- the RFC 1123 compliant string to parse.- Returns:
- the parsed
ZonedDateTime
-
-