Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

String to time stamp  RSS feed

 
Nagendra Shastry
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,

I have a string which has the value of a date 2013/03/12 . I want set it to a time stamp variable with same value i.e., 2013/03/12 . Can you please help?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16006
87
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use java.text.SimpleDateFormat (<= click to see the API documentation) with the appropriate format string to parse the string into a java.util.Date object.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!