swift-Date时间比较
letdate1=Date()
letdate2=Date()
// date1 < date2 升序排列
ifdate1?.compare(date2!) == .orderedAscending
{
print("<")
}
//date1 = date2 相等
ifdate1?.compare(date2!) == .orderedSame
{
print(" = ")
}
//降序排列的 date1 > date2 降序排列
ifdate1?.compare(date2!) == .orderedDescending
{
print(">")
}