Skip to content

Instantly share code, notes, and snippets.

@mingder78
Created December 17, 2011 15:33
Show Gist options
  • Select an option

  • Save mingder78/1490504 to your computer and use it in GitHub Desktop.

Select an option

Save mingder78/1490504 to your computer and use it in GitHub Desktop.
SimpleDateFormat
String v_date_str="Sun Mar 06 11:28:16 IST 2011"; DateFormat formatter; formatter = new SimpleDateFormat("EEE MMM d HH:mm:ss zzz yyyy"); Date date_temp=null; String d_temp=null; SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy"); try { date_temp = (Date) formatter.parse(v_date_str); d_temp = dateFormat.format(date_temp); System.out.println("val : "+d_temp); } catch (ParseException ex) {//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment