This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new Date and currentTimeMillis

 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do new Date() and new Date(System..currentTimeMillis()) suppose to be equal?
In Linux RH, JDK 1.6 result has time difference about 95 days. The system stays on for more than one year.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by D Rog:
Do new Date() and new Date(System..currentTimeMillis()) suppose to be equal? ...

Yes. I'm using Java 5 on a Mac, but in the source code for java.util.Date, the no-args constructor is simply...

I tested this with...

[ February 25, 2007: Message edited by: marc weber ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried the same on a Windows Machine, jdk1.6 :

Mon Feb 26 11:18:29 JST 2007
Mon Feb 26 11:18:29 JST 2007
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic