Hi I have Unix epoch time i.e.,"1187813802", but when i try to convert into to Java Date as below.. SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); String longModtime = formatter.format(new Date(Long.parseLong("1187813802")));
It should give "2007-08-22 20:16" but its showing Year as 1970, Could anybody please tell me how to do this.
Date takes a Long argument as a usable timestamp. That Long value is the number of *milliseconds* since the epoch. A UNIX timestamp is the number of *seconds* since the epoch. Hopefully you can figure it out now
Joined: Oct 04, 2004
Sorry, I didn't got what exactly you are saying
Joined: Jan 14, 2007
Originally posted by vamshidhar nimbagiri: Sorry, I didn't got what exactly you are saying