Here you can find the source of changeDate(String argDate)
public static String changeDate(String argDate)
//package com.java2s; //License from project: Apache License public class Main { public static String changeDate(String argDate) { if (argDate == null || argDate.trim().equals("")) { return ""; }/*from w ww . j a va2 s . c om*/ String result = ""; if (argDate.length() == 10 && argDate.indexOf("/") > 0) { return argDate; } String[] str = argDate.split("[.]"); int LEN = str.length; for (int i = 0; i < LEN; i++) { if (str[i].length() == 1) { if (str[i].equals("0")) { str[i] = "01"; } else { str[i] = "0" + str[i]; } } } if (LEN == 1) { result = argDate + "/01/01"; } if (LEN == 2) { result = str[0] + "/" + str[1] + "/01"; } if (LEN == 3) { result = str[0] + "/" + str[1] + "/" + str[2]; } return result; } }