1
那是我的倒計時代碼。我想知道如何從我的代碼中排除星期五或星期六的examlpe。提前致謝。如何排除我倒計時的星期五
public void run() {
handler.postDelayed(this, 1000);
try {
SimpleDateFormat dateFormat = new SimpleDateFormat(
"yyyy-MM-dd");
// Event Date
Date futureDate = dateFormat.parse("2017-4-2");
Date currentDate = new Date();
if (!currentDate.after(futureDate)) {
long diff = futureDate.getTime()
- currentDate.getTime();
long days = diff/(24 * 60 * 60 * 1000);
diff -= days * (24 * 60 * 60 * 1000);
long hours = diff/(60 * 60 * 1000);
diff -= hours * (60 * 60 * 1000);
long minutes = diff/(60 * 1000);
diff -= minutes * (60 * 1000);
long seconds = diff/1000;
其餘代碼被刪除。
請提供完整信息 –