This repository was archived by the owner on Apr 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-18
lines changed
src/main/java/com/tagmycode/sdk Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Original file line number Diff line number Diff line change 196196 <artifactId >log4j</artifactId >
197197 <version >1.2.17</version >
198198 </dependency >
199- <!-- javax.xml.bind.DatatypeConverter removed in Java 11 -->
200- <dependency >
201- <groupId >javax.xml.bind</groupId >
202- <artifactId >jaxb-api</artifactId >
203- <version >2.3.0</version >
204- </dependency >
205- <dependency >
206- <groupId >com.sun.xml.bind</groupId >
207- <artifactId >jaxb-core</artifactId >
208- <version >2.3.0</version >
209- </dependency >
210- <dependency >
211- <groupId >com.sun.xml.bind</groupId >
212- <artifactId >jaxb-impl</artifactId >
213- <version >2.3.0</version >
214- </dependency >
215199
216200 <!-- test scope -->
217201 <dependency >
Original file line number Diff line number Diff line change 11package com .tagmycode .sdk ;
22
3- import javax .xml .bind .DatatypeConverter ;
43import java .text .DateFormat ;
54import java .text .SimpleDateFormat ;
5+ import java .time .LocalDateTime ;
6+ import java .time .ZoneOffset ;
7+ import java .time .ZonedDateTime ;
68import java .util .Date ;
79import java .util .Locale ;
810import java .util .TimeZone ;
@@ -18,7 +20,9 @@ public DateParser(Date date) {
1820 }
1921
2022 public static Date parseDate (String dateString ) {
21- return DatatypeConverter .parseDateTime (dateString ).getTime ();
23+ ZonedDateTime zonedDateTime = ZonedDateTime .parse (dateString );
24+ LocalDateTime localDateTime = LocalDateTime .ofInstant (zonedDateTime .toInstant (), ZoneOffset .UTC );
25+ return Date .from (localDateTime .atZone (ZoneOffset .UTC ).toInstant ());
2226 }
2327
2428 public String toISO8601 () {
You can’t perform that action at this time.
0 commit comments