Here you can find the source of formatDate(String inputStr)
Parameter | Description |
---|---|
inputStr | a parameter |
public static String formatDate(String inputStr)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { /**/*ww w.java 2 s.com*/ * @param inputStr * @return */ public static String formatDate(String inputStr) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { return sdf.format(sdf.parse(inputStr)); } catch (ParseException e) { e.printStackTrace(); } return ""; } }