Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Locale; public class Main { public static long addUTCTime(long timeMillis) { Calendar cal = Calendar.getInstance(Locale.getDefault()); int zoneOffset = cal.get(java.util.Calendar.ZONE_OFFSET); int dstOffset = cal.get(java.util.Calendar.DST_OFFSET); timeMillis = timeMillis + zoneOffset + dstOffset;// if (start.after(end)) { return timeMillis; } }