It's not a secret anymore!*
The moose likes Beginning Java and the fly likes String to time stamp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String to time stamp" Watch "String to time stamp" New topic
Author

String to time stamp

Nagendra Shastry
Greenhorn

Joined: Oct 26, 2010
Posts: 19

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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String to time stamp
 
Similar Threads
ID number errors
Insertion issue in Oracle database
Get Sum of column and the retrive the data month wise.
sorting by date and time
Date Format With Time Zone Offset