Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { private static long currentTime() { Calendar time = Calendar.getInstance(); time.add(Calendar.MILLISECOND, -time.getTimeZone().getOffset(time.getTimeInMillis())); return time.getTime().getTime(); } }