func getMorningDate(date:Date) -> Date{
let calendar = NSCalendar.init(identifier: .chinese)
let components = calendar?.components([.year,.month,.day], from: date)
return (calendar?.date(from: components!))!
}
func getMorningDate(date:Date) -> Date{
let calendar = NSCalendar.init(identifier: .chinese)
let components = calendar?.components([.year,.month,.day], from: date)
return (calendar?.date(from: components!))!
}
本文标题:Swift3 根据日期获取当天零点的时间戳
本文链接:https://www.haomeiwen.com/subject/xkwvvxtx.html
网友评论