Here you can find the source of getDayStr(Calendar cal)
public static String getDayStr(Calendar cal)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static String getDayStr(Calendar cal) { return cal.get(Calendar.DATE) > 9 ? "" + cal.get(Calendar.DATE) : "0" + cal.get(Calendar.DATE); }/* w w w. ja v a2s . c o m*/ }