Last updated on June 7th, 2015 at 04:33 pm

In this tip i help you to convert Epoch time  to actual time.

Wiki definition:

  1. Unix time (also known as POSIX time or erroneously as Epoch time) is a system for describing instants in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time(UTC), Thursday, 1 January 1970, not counting leap seconds.

Example: When we need to find the date of application install we get that time in Epoch format so we need to convert that time to understandable format.

Epoch time:  

1433423118000

I just create a simple method to convert it into actual format

public static String EpochToDate(long time, String formatString) {
    SimpleDateFormat format = new SimpleDateFormat(formatString);
    return format.format(new Date(time));

}

Output

04-06-2015

😉