Skip to content

Instantly share code, notes, and snippets.

@kawamurayuto
Last active November 8, 2016 10:08
Show Gist options
  • Select an option

  • Save kawamurayuto/7afd8a35cb50471147a9bc311fc19143 to your computer and use it in GitHub Desktop.

Select an option

Save kawamurayuto/7afd8a35cb50471147a9bc311fc19143 to your computer and use it in GitHub Desktop.
Swift3 で今日の0時0分0秒を取得する ref: http://qiita.com/kawamurayuto/items/93e9c48174ad080ee973
let calendar = Calendar(identifier: .gregorian)
calendar.date(bySettingHour: 0, minute: 0, second: 0, of: Date()) // Nov 7, 2016, 12:00 AM
let calendar = Calendar(identifier: .gregorian)
calendar.startOfDay(for: Date()) // Nov 7, 2016, 12:00 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment