Posted By

miceno on 01/21/11


Tagged

date


Versions (?)

Convert a String (atom date) to Date


 / Published in: Groovy
 

  1. import java.util.Date
  2. import java.text.SimpleDateFormat
  3.  
  4. String myDate= '2011-01-20T13:51:24.63Z'
  5.  
  6. Date dtTmp = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss").parse( myDate);
  7.  
  8. println dtTmp.toString()

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: miceno on January 24, 2011

This is an example of a Date to String conversion and Date parsing.

You need to login to post a comment.