N
N
Ntari2019-03-08 21:45:44
Java
Ntari, 2019-03-08 21:45:44

Why is the date being parsed incorrectly?

I'm trying to parse the date like this:

new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH).parse("Thu, 07 Mar 2019 21:39:50 +0000")

But for some reason it returns today's date. What's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Oparin, 2019-03-08
@Ntari

It most likely returns not today, but "2019-03-08T01:39:50.000+0400"?
What is your timezone?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question