Calendar calendar = Calendar.getInstance();
//Subtract 3 months from the current time. If it is a negative number, the year will be pushed forward. For example, January-3, 2010 will become October 2009
calendar. add (Calendar.MONTH, -3 );
Timestamp time = new Timestamp(calendar.getTimeInMillis());
//Get the customer's last order time---orderTime
CustomerOrder cusOrder = this .df.getCustomerOrderDao(). get (customerId);
Timestamp orderTime = cusOrder.getTime();
//Determine whether it has expired, true means more than 3 months
if (time.after(orderTime)){
};
Read More:
- How to get the current time in java time string
- JAVA: How to Read JSON Format Data (Web Game Development)
- Conversion of two data types in Java
- Resin Failed to Startup Error: ERROR: transport error 202: bind failed: Address already in use: JVM_Bind Listenin (Two Resins in One PC)
- [Solved] Error attempting to get column ‘xxxx_time‘ from result set. Cause: java.sql.SQLFeatureNotSupportedEx
- How to Close the Current Form in JAVA Swing
- Mybatis single parameter pass in exception (How to Fix)
- How to Solve Image Upload Error: Uncaught (in promise) DOMException: Failed to execute ‘put‘ on ‘IDBObjectStore‘
- How to Solve Error executing DDL in JPA
- How to Converte Java objects to jsonnode in Jackson (Four Methods)
- How to Open Files by Dragging and Dropping in C#
- How to Solve SQL comments error in the mybatis query
- How to Solve JDBC connection error in spring MVC integration
- The problem of date format conversion between springboot and front end
- [Solved] Seata Error: endpoint format should like ip:port
- How to Solve zipkin Install Error in Windows
- How to Fix COM Surrogate has stopped working in Windows 7
- How to Solve classnotfoundexception error in spark without Hadoop runtime
- How to Solve Tomcat Error: Could not resolve view with name ‘xxx/xxxxxxx‘ in servlet with
- [Solved] mybatis Error querying database. Cause: java.sql.SQLException: The server time zone value