// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;
import java.text.*;

public class TimeFun {
   public static void main(String[] args) {
      DateFormat df = new SimpleDateFormat("HH:mm:ss");
      // seconds since midnigth local time
      int nsecs = 17*60*60+34*60+18;
      // date without correcting for that it expects GMT
      Date d1 = new Date(nsecs * 1000);
      System.out.println(df.format(d1));
      // date correcting for that it expects GMT
      Date d2 = new Date(nsecs * 1000 - Calendar.getInstance().getTimeZone().getRawOffset());
      System.out.println(df.format(d2));
   }
}
