-1

Can someone help me to get the right patter for this Date format:

20150722T112009,64+02 (which is "22 July 2015 11:20:09" < would be enough)

I have no idea what **,64** is nor what **+02** stands for so can someone help me to get the java Date object of this string?

My current pattern so far:

yyyyMMdd'T'HHmmss','
Pali
  • 1,337
  • 1
  • 14
  • 40
  • possible duplicate of [java : Unparseable date Exception](http://stackoverflow.com/questions/9223833/java-unparseable-date-exception) – Basil Bourque Jul 22 '15 at 19:00
  • If, instead of posting, you had looked at any of the hundreds of Questions and Answers already posted on the topic on StackOverflow you would have discerned the meaning of fractions of a second and of an offset from UTC. – Basil Bourque Jul 22 '15 at 19:03
  • @BasilBourque I have search for this a couple of times but I only found examples with millisecond format with 3 digits and no `+02` so I was confused if the format was maybe an IBM-proprietary format but thank you anyway ... – Pali Jul 23 '15 at 06:14

1 Answers1

1

The logical conclusion for 64 and +02 would be 64 milliseconds and GMT+02 timezone.

So, your pattern would be

"yyyyMMdd'T'HHmmss,SSX"

That will give you the proper date.

Codebender
  • 14,221
  • 7
  • 48
  • 85
  • Actually, that would be `640 milliseconds`, not 64. Think of it as in `x,640` (or x.640 for we Americans). – Basil Bourque Jul 23 '15 at 06:34
  • By the way, note that the offset of `+02` is short for `+02:00`. Be aware that the new java.time framework in Java 8 and later originally had a bug in failing to parse such abbreviated offsets; I don't know if that is still the case with recent upgrades. Also, know that the leading zero is not optional, use `+02` not `+2`. – Basil Bourque Jul 23 '15 at 06:39