Here you can find the source of FormatDate6(String strDate)
public static String FormatDate6(String strDate)
//package com.java2s; //License from project: Open Source License public class Main { public static String FormatDate6(String strDate) {//from w w w . ja v a 2 s . c o m if (strDate == null) { return ""; } strDate = strDate.trim(); if (strDate.length() < 6) { return ""; } else { return "20" + strDate.substring(0, 2) + "-" + strDate.substring(2, 4) + "-" + strDate.substring(4); } } }