I have time coming from gpslocation service in 1352437114052 format. Can some one tell me how to convert this into local time either in Java or Matlab or Excel.
Advertisement
Answer
Create a new Date
from your milliseconds since epoch. Then use a DateFormat
to format it in your desired timezone.
Date date = new Date(1352437114052L); DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); format.setTimeZone(TimeZone.getTimeZone("PST")); System.out.println(format.format(date));