Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-27-2007, 09:34 PM
Member
 
Join Date: Jul 2007
Posts: 41
gabriel is on a distinguished road
problem with date class
Code:
Date dday1=new Date(2007,6,31); Date dday2=new Date(2005,1,1); long sDay1=dday1.getTime(); long sDay2=dday2.getTime(); System.out.println(""+sDay1+"---"+sDay2);
it returns to me :1120147200000---1120147200000
why?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-27-2007, 11:31 PM
Senior Member
 
Join Date: Jul 2007
Posts: 134
brianhks will become famous soon enough
You should use the java.text.DateFormat object to print out your Date objects in a more readable format.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-27-2007, 11:34 PM
Senior Member
 
Join Date: Jul 2007
Posts: 134
brianhks will become famous soon enough
As for why here is the description of java.util.Date.getTime from the java docs
"Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object."
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-03-2007, 02:28 PM
Member
 
Join Date: Jul 2007
Posts: 41
gabriel is on a distinguished road
haha, it was a silly question!!!
anyway, thanks brianhks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between current date and anothe date vijay balusamy New To Java 1 04-16-2008 05:15 PM
problem in wrapper class binoympappachen New To Java 4 12-13-2007 01:31 PM
Class problem Deagel New To Java 1 10-31-2007 08:33 PM
Problem calling another class adlb1300 New To Java 3 10-25-2007 03:05 PM
problem with date field Ed Database 2 06-12-2007 05:27 PM


All times are GMT +3. The time now is 08:47 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org