Timestamp to Local time in long
import java.util.Calendar; import java.util.GregorianCalendar; class Main { public static long toLocal(long timestamp) { Calendar cal = Calendar.getInstance(); int offset = cal.getTimeZone().getOffset(timestamp); return timestamp - offset; } }