标签:
String oneHoursAgoTime="";
Date dt = new Date();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd-HH");
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(dt);
//rightNow.add(Calendar.DATE, -1);
rightNow.add(Calendar.HOUR, -1);
Date dt1=rightNow.getTime();
oneHoursAgoTime = sdf.format(dt1);
return oneHoursAgoTime;
标签:
原文地址:http://www.cnblogs.com/yg-Manager/p/4202902.html