Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个假设“我的考试”的通知。
我想在设定日期前 3 天显示提醒通知
我将日期存储在数据库中想要将其与当前日期进行比较并显示通知
任何帮助将不胜感激
谢谢你...
要生成比特定日期早 3 天的日期,请尝试以下操作:
Calendar c = Calendar.getInstance(); c.set(year, month, day); // Set the calendar NOTE: this will not change the hour, minute, second c.add(Calendar.DAY_OF_YEAR, -3); // Roll the calendar back 3 days