File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes getTimeStamp() date time format is bad Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "getTimeStamp() date time format is bad" Watch "getTimeStamp() date time format is bad" New topic
Author

getTimeStamp() date time format is bad

Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
I have got following time when i used getJMSTimestamp() in MDB.



The time checked while sending was 10:34:06 and Date 13 May 2011

I am not getting where year, and time is coming. Kindly check.


Regards
Azrael Noor
Mike Zal
Ranch Hand

Joined: May 04, 2011
Posts: 144

Time in Java is saved as milliseconds since Midnight January 1, 1970. You can use the java.util.Date Class or preferably the java.util.Calendar Interface to manipulate it in useable manner. More Details


OCJP6, OCWCD5
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
Thank You
I had used following to convert long type date.

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The normal way to do this sort of thing is with a DateFormat.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382

You are late.

Already Implemented and submitted at Super University
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Well sorry I missed the deadline I neither knew nor cared about. Hopefully you now you know the correct way to do it in the future.
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
no sorry just
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getTimeStamp() date time format is bad