📜  检查当前时间是否在早上 c# 代码示例

📅  最后修改于: 2022-03-11 14:48:53.752000             🧑  作者: Mango

代码示例1
TimeSpan time = DateTime.Now.TimeOfDay;

if (time > new TimeSpan(00, 00, 01)        //Hours, Minutes, Seconds
 && time < new TimeSpan(08, 00, 00)) {
    //match found
}