From owner-freebsd-java Tue Feb 12 20:12: 1 2002 Delivered-To: freebsd-java@freebsd.org Received: from chen.org.nz (adsl-210.54.19.51.quicksilver.net.nz [210.54.19.51]) by hub.freebsd.org (Postfix) with ESMTP id A7F0237B402 for ; Tue, 12 Feb 2002 20:11:54 -0800 (PST) Received: (from jonc@localhost) by chen.org.nz (8.11.6/8.11.6) id g1D4BeP08751; Wed, 13 Feb 2002 17:11:40 +1300 (NZDT) (envelope-from jonc) Date: Wed, 13 Feb 2002 17:11:40 +1300 From: Jonathan Chen 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > 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 ------------------------------------------------------------------------ "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