The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Use Date dateAgain = new Date ( db_result ) ;

Posted by Kishori Sharan on January 30, 2001 at 7:37 PM

To get the date object back just use this result in constructor of Date class. Suppose, you have the date result in a long variable like
long db_result = 979885155970 ; //

// If you have a string then do like
try {
db_result = Long.parseLong ( "979885155970" ) ;
}
catch ( Exception e ) {
}

// To get a date object using your result from database
Date dateAgain = new Date ( db_result ) ;

Now use you dateAgain object in whatever way you want...

Thanx
Kishori



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us