I have tested the following code in four machines. Two of those are windows(win7 & win8), and two are linux(centos). Output on the windows pc are same(but different with linux).
java.sql.Time d = java.sql.Time.valueOf("19:54:17");
System.out.println(d.getTime());
Windows output: 50057000
Linux output: 93257000
Windows: java version "1.6.0_26"
Linux: java version "1.6.0_24"
Times are slightly different amongst the machines(in 2-3 minutes). But Windows are having UTC+6 and Linux are having GMT+6 timezone.
Another info. I have also had a run this code on this online Java compiler and it shows the output 93257000
I just want to have equal output from all my machines. What should I do?
Update: as you requested the output for this code System.out.println(new Date(d.getTime())):
Windows: Thu Jan 01 19:54:17 ALMT 1970
Linux: Thu Jan 01 19:54:17 GMT-06:00 1970
Online Compiler: Thu Jan 01 19:54:17 CST 1970
new Date(d.getTime());?