import java.util.Date; import java.text.SimpleDateFormat; public class WriteForBlog { static private int beforeDays = 8; // Use this vaule to judge the start date within 7 days. static private long beforeSeconds = beforeDays * 24 * 60 * 60 * 1000; pu…
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd"); Date d1=format.parse(FHavetime); Date nowdate=new Date(); Date d2=format.parse(format.format(nowdate)); DcSiteMessagemodel dcyuyue=dcSiteMessageMng.getByid(3); DcSiteMessagemodel dcwaim…
public static void main(String[] args) { Date date = new Date(); SimpleDateFormat df = new SimpleDateFormat("HH"); String str = df.format(date); int a = Integer.parseInt(str); if (a >= 0 && a <= 6) { System.out.println("凌晨&quo…
转自:https://blog.csdn.net/iteye_8535/article/details/82246006 JAVA时间进行比较和转换,时间加减得到天数 1. 把时间类型的字符串转为DATE import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Text { public static void main(String[] arg…