user3708915
user3708915

Reputation: 341

Convert to UNIX timestamp error

I used this to get the timestamp

long epoch = new java.text.SimpleDateFormat ("dd/MM/yyyy HH:mm:ss").parse("09/22/2008 16:33:00").getTime();

It returns 989929568.

Then I used online converter to change this number back to standard time,

what I get is

05 / 15 / 01 @ 12:26:08pm

, not

09/22/2008 16:33:00

What is happening?

Upvotes: 0

Views: 228

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240928

change pattern to

MM/dd/yyyy HH:mm:ss

because 22 cannot be month

Upvotes: 6

Related Questions