标签:
打印输出昨天的当前时间
package ForeverLover; import java.text.SimpleDateFormat; import java.util.Calendar; public class DateSystem { /** * @author ForeverLover */ public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -1); System.out.println(sdf.format(cal.getTime())); } }
标签:
原文地址:http://www.cnblogs.com/ForeverLover/p/4667854.html