我有一个8个日期对象的列表,如下所示:
0. June 01, 2017
1. June 23, 2017
2. June 13, 2017
3. June 27, 2017
4. June 17, 2017
5. June 04, 2017
6. June 09, 2017
7. June 11, 2017
8. June 15, 2017
根据上面的数据,我如何(对于date_list
中的每个日期)检查该日期是否是周末(sat | sun)?根据答案,我将在if块中分配变量:
if (date != weekend){
weekdayCode();
} else {
weekendCode();
}
将其解析为datetime并调用
weekday()
。你知道吗相关问题 更多 >
编程相关推荐