We Recommend

Java How to Program Java How to Program
Takes a new tools-based approach to Web application development that uses Netbeans 5.5 and Java Studio Creator 2 to create and consume Web Services. Features new AJAX-enabled, Web applications built with JavaServer Faces (JSF), Java Studio Creator 2 and the Java Blueprints AJAX Components. Includes new topics throughout, such as JDBC 4, SwingWorker for multithreaded GUIs, GroupLayout, Java Desktop Integration Components (JDIC), and much more.


Posted By

indianocean on 01/16/07


Tagged

date


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

markireland
bobmin
zdroshnya


Convert String to Date


Published in: Java 


  1. String strTmp = "15.01.2007";
  2. Date dtTmp = new SimpleDateFormat("dd.MM.yyyy").parse(strTmp);
  3. String strOutDt = new SimpleDateFormat("yyyy-MM-dd").format(dtTmp);
  4. System.out.println(strOutDt);

Report this snippet 

You need to login to post a comment.