File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes time stamp question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "time stamp question" Watch "time stamp question" New topic
Author

time stamp question

Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
can I send time stamp in 'ddmmyyyyhhss' format across the wire(like a post or get parameter) and retrieve as a string and compare with time on the other side. Is it possible to recreate date from the above string?


Kishore
SCJP, blog
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Sure, it's possible.

You can use java.text.DateFormat
[ October 14, 2004: Message edited by: somkiat puisungnoen ]

SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
but if i use, simpledateformat("the string i got over the wire") it gives unparsable content error.

The string can be seen as like "10/15/2004 03:08:51 AM" and my code is below:
Date userDate = new SimpleDateFormat().parse(timeStamp);

Any thoughts???
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Kishore Dandu:
but if i use, simpledateformat("the string i got over the wire") it gives unparsable content error.

The string can be seen as like "10/15/2004 03:08:51 AM" and my code is below:
Date userDate = new SimpleDateFormat().parse(timeStamp);

Any thoughts???


I can parse "10/15/2004 03:08:51".

Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
thanks it works now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: time stamp question
 
Similar Threads
"Refreshing" jsp
Hibernate Date Issue
Ajax problem while refreshing data
getting last row
Best Way to Edit a Byte Array