aspose file tools*
The moose likes Beginning Java and the fly likes Convert A given date into long Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Convert A given date into long" Watch "Convert A given date into long" New topic
Author

Convert A given date into long

kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Hi,

I have a formatted date as given below--



Is there any way to convert this string into long value?

I tried to use


But it's throwing
format.parseObject(String) failed
exception.
Antany Vasanth
Ranch Hand

Joined: Jan 28, 2009
Posts: 43
Hi

Try this.



Regards
Antany.
kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Yes Antany. It's working fine.
Thanks a lot.

Wel i have one more query.

I am using the following code for getting last modified date.



But the problem is this it's not giving 24 hrs format.

How to get that?

Thanks,
Kaya.
Antany Vasanth
Ranch Hand

Joined: Jan 28, 2009
Posts: 43
Hi Kya,



Regards
Antany
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

Please read the API documentation of class SimpleDateFormat, it explains exactly how the format string works.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Thanks a lot Antany.

It was really helpful.

Thank you once again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convert A given date into long
 
Similar Threads
Regarding Exceptions!
Inserting Date value by using JSP......Please help
IllegalArgumentException
Formatting the date
get the Yesterday's date ??