Class DateUtils
java.lang.Object
org.craftercms.studio.impl.v2.utils.DateUtils
Utility methods for handling dates
- Since:
- 4.0.0
- Author:
- joseross
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatCurrentTime
(String pattern) Applies the given pattern to format the current time in UTCstatic String
formatCurrentTime
(DateTimeFormatter formatter) Applies the given formatter to the current time in UTCstatic String
formatDate
(ZonedDateTime dateTime, String patter) Formats a date using any patternstatic String
formatDate
(ZonedDateTime dateTime, DateTimeFormatter formatter) Formats a date using a formatterstatic String
formatDateIso
(ZonedDateTime dateTime) static ZonedDateTime
Returns the current time in UTCstatic String
Returns the current time in UTC formatted using the ISO standardstatic ZonedDateTime
parseDate
(String value, DateTimeFormatter formatter) Parses a date using a formatterstatic ZonedDateTime
parseDateIso
(String value) Parses a date using the UTC formatter
-
Field Details
-
ISO_FORMATTER
-
-
Constructor Details
-
DateUtils
public DateUtils()
-
-
Method Details
-
getCurrentTime
Returns the current time in UTC -
formatCurrentTime
Applies the given formatter to the current time in UTC -
getCurrentTimeIso
Returns the current time in UTC formatted using the ISO standard -
formatCurrentTime
Applies the given pattern to format the current time in UTC -
formatDate
Formats a date using any pattern -
formatDateIso
-
formatDate
Formats a date using a formatter -
parseDate
Parses a date using a formatter -
parseDateIso
Parses a date using the UTC formatter
-