How can I parse the following String "1394133302" which correspond of Date.toString value to a Date value (java utils).
Is it possible with a SimpleDateFormat?
Use code below
new Date(Long.valueOf("1394133302"))
PS. It seems you date string is in second, maybe you want this(convert it to millesecond!)
new Date(Long.valueOf("1394133302") * 1000L)
Just feed it back into the Date constructor:
long dateAsLong = Long.parseLong( "1394133302");
Date someDate = new Date(dateAsLong);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With