Date: Wed, 13 Feb 2002 17:11:40 +1300 From: Jonathan Chen <jonc@chen.org.nz> To: timster@blackcore.com Cc: freebsd-java@freebsd.org Subject: Re: Incorrect timestamps with native 1.3.1 jdk? Message-ID: <20020213171140.A8612@grimoire.chen.org.nz>
next in thread | raw e-mail | index | archive | help
> The problem I have is that I'm getting timestamps that seem incorrect. I > wrote a very simple test application that instances a current Date object, > then spits out the timestamp in a long format. I compared that with the > timestamp that's returned on my OSX development machine which I ran at the > same time. > They're really different (more than just a few milliseconds difference). If I write a simple program: import java.util.Date; public class DateTest { static void main ( String args []) { Date now = new Date (); System.out.println ("Now = " + (now.getTime () / 1000)); } } And the run it: /tmp,5:05pm> java DateTest Now = 1013573273 /tmp,5:07pm> date +%s 1013573276 The results are what I expect it to be (ie 3 seconds difference from when I ran the java program and when I typed in "date +%s"). So, from what I see, there doesn't appear to be a problem with the Date object at all. -- Jonathan Chen <jonc@chen.org.nz> ------------------------------------------------------------------------ "We laugh in the face of danger, we drop icecubes down the vest of fear" - Edmond Blackadder III To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020213171140.A8612>