Swift3 根据日期获取当天零点的时的日期

Swift3 获取当天零点的时的日期
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!))!
    }
  • 发表于 2017-11-24 09:29
  • 阅读 ( 2031 )
  • 分类:ios

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
不写代码的码农
Alan

iOS开发

14 篇文章

作家榜 »

  1. 威猛的小站长 124 文章
  2. Jonny 65 文章
  3. 江南烟雨 36 文章
  4. - Nightmare 33 文章
  5. doublechina 31 文章
  6. HJ社区-肖峰 29 文章
  7. 伪摄影 22 文章
  8. Alan 14 文章