Back to project page InitHub-Android.
The source code is released under:
MIT License
If you think the Android project InitHub-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.solutiosoft.android.inithub; //from w w w. j av a 2s . co m import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Utils { public static String formatCreateDate(String date_string, String format){ try { //Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").parse(date_string); Date date = new SimpleDateFormat(format).parse(date_string); String newstring = new SimpleDateFormat("EEE, MMM d yyyy HH:mm").format(date); return newstring; } catch (ParseException e) { return date_string; } } }