This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert A given date into long

 
kayanaat sidiqui
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Try this.



Regards
Antany.
 
kayanaat sidiqui
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kya,



Regards
Antany
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read the API documentation of class SimpleDateFormat, it explains exactly how the format string works.
 
kayanaat sidiqui
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Antany.

It was really helpful.

Thank you once again.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic