Skip to content

Commit

Permalink
#2110 Fix date parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 19, 2021
1 parent 8dcf087 commit cf13f69
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions misp/client/src/main/scala/org/thp/misp/dto/Attribute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ case class Attribute(

object Attribute {

val formatter: DateTimeFormatter = new DateTimeFormatterBuilder()
.append(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
.appendPattern("XX")
.toFormatter
def parseDate(s: String): Date = new Date(OffsetDateTime.parse(s, formatter).toInstant.toEpochMilli)
def parseDate(s: String): Date =
javax.xml.bind.DatatypeConverter.parseDateTime(s).getTime

implicit val reads: Reads[Attribute] =
((JsPath \ "id").read[String] and
Expand Down

0 comments on commit cf13f69

Please sign in to comment.