Posted By

indianocean on 01/16/07


Tagged

date


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

markireland
bobmin
zdroshnya
rtipton


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.