本文主要介绍了C#中DateTime.Compare()比较时间大小
目录
定义
实例
运行结果
定义
C#中的DateTime.Compare()方法用于比较两个DateTime实例。它返回一个整数值,
<0-如果date1早于date2
0-如果date1与date2相同
> 0-如果date1晚于date2
实例
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace d