public Strftime(String origFormat) {
translate = new Properties();
translate.put("a","EEE");
translate.put("A","EEEE");
translate.put("b","MMM");
translate.put("B","MMMM");
translate.put("c","EEE MMM d HH:mm:ss yyyy");
//There's no way to specify the century in SimpleDateFormat. We don't want to hard-code
//20 since this could be wrong for the pre-2000 files.
//translate.put("C", "20");
translate.put("d","dd");
translate.put("D","MM/dd/yy");
translate.put("e","dd"); //will show as '03' instead of ' 3'
translate.put("F","yyyy-MM-dd");
translate.put("g","yy");
translate.put("G","yyyy");
translate.put("H","HH");
translate.put("h","MMM");
translate.put("I","hh");
translate.put("j","DDD");
translate.put("k","HH"); //will show as '07' instead of ' 7'
translate.put("l","hh"); //will show as '07' instead of ' 7'
translate.put("m","MM");
translate.put("M","mm");
translate.put("n","\n");
translate.put("p","a");
translate.put("P","a"); //will show as pm instead of PM
translate.put("r","hh:mm:ss a");
translate.put("R","HH:mm");
//There's no way to specify this with SimpleDateFormat
//translate.put("s","seconds since ecpoch");
translate.put("S","ss");
translate.put("t","\t");
translate.put("T","HH:mm:ss");
//There's no way to specify this with SimpleDateFormat
//translate.put("u","day of week ( 1-7 )");
//There's no way to specify this with SimpleDateFormat
//translate.put("U","week in year with first sunday as first day...");
translate.put("V","ww"); //I'm not sure this is always exactly the same
//There's no way to specify this with SimpleDateFormat
//translate.put("W","week in year with first monday as first day...");
//There's no way to specify this with SimpleDateFormat
//translate.put("w","E");
translate.put("X","HH:mm:ss");
translate.put("x","MM/dd/yy");
translate.put("y","yy");
translate.put("Y","yyyy");
translate.put("Z","z");
translate.put("z","Z");
translate.put("%","%");
String convertedFormat = convertDateFormat( origFormat );
simpleDateFormat = new SimpleDateFormat( convertedFormat );
}
Create an instance of this date formatting class |