-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for unit tests (via #19)
- Loading branch information
1 parent
040452a
commit 5474ae7
Showing
4 changed files
with
78 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/io/eroshenkoam/xcresults/util/ParseUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.eroshenkoam.xcresults.util; | ||
|
||
import java.text.ParseException; | ||
import java.text.SimpleDateFormat; | ||
|
||
public final class ParseUtil { | ||
|
||
private ParseUtil(){ | ||
} | ||
|
||
@SuppressWarnings("PMD.SimpleDateFormatNeedsLocale") | ||
public static Long parseDate(final String date) { | ||
final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); | ||
try { | ||
return format.parse(date).getTime(); | ||
} catch (ParseException e) { | ||
return null; | ||
} | ||
} | ||
|
||
} |