Package net.obvj.confectory.util
Class DateUtils
- java.lang.Object
-
- net.obvj.confectory.util.DateUtils
-
public class DateUtils extends Object
Common methods for working with dates.- Since:
- 2.5.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DateparseDateRfc3339(String string)Parses the given date-time representation string based in RFC-3339 format, producing aDate.static InstantparseInstantRfc3339(String string)Parses the given date-time representation string based in RFC-3339 format, producing anInstant.
-
-
-
Method Detail
-
parseDateRfc3339
public static Date parseDateRfc3339(String string)
Parses the given date-time representation string based in RFC-3339 format, producing aDate.Either of the following examples are acceptable:
"2019-09-07T13:21:59Z""2020-10-08 13:22:58.654Z""2021-11-09T10:23:57.321+00:00""2022-12-10 10:24:56.987654321-03:00"
- Parameters:
string- the string to parse; not null- Returns:
- the parsed
Date; not null
-
parseInstantRfc3339
public static Instant parseInstantRfc3339(String string)
Parses the given date-time representation string based in RFC-3339 format, producing anInstant.Either of the following examples are acceptable:
"2019-09-07T13:21:59.987Z""2020-10-08 13:22:58.654Z""2021-11-09T10:23:57.321+00:00""2022-12-10 10:24:56.987654321-03:00"
- Parameters:
string- the string to parse; not null- Returns:
- the parsed
Instant; not null
-
-