How to convert String to Date Time format in Java

Tutorials Shared by the Internet Community


  Top Tutorials     New Tutorials     Submit     Login     Register  

How to convert String to Date Time format in Java

How to convert String to Date Time format in Java
  • Total Hits: 5383

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating


  • Total Votes: 10 votes

  • Category: JAVA/Core JAVA

  • Submitted on: 2014-03-16 09:28:51

  • Submitted By: Appu T

  • Set as Favorite


In this tutorial we are going to see how to convert String to Date Time format using SimpleDateFormat. 1. 12-10-2013 12:02:35 PM format to Util Date Timepackage com.javatutorialscorner.util;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Date;public class StringToDateConvertion { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub SimpleDateFormat dateFormat = null; String inputDate = "12-10-2013 12:02:35 PM"; try { dateFormat = new SimpleDateFormat("dd-MM-yyyy... - See more at:    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 20%  2
 Two starsTwo star  Vote LeftVote MiddleVote Right 20%  2
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 20%  2
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 20%  2
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 20%  2

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.