更新时间:2023-11-26 20:05:04
查看 NSCalendar
的 startOfDayForDate
方法来查找当天的开始.
Check out NSCalendar
's startOfDayForDate
method to find the start of the current day.
要查找当天的结束时间,您需要在从 startOfDayForDate
返回的日期中添加一天,然后减去一秒.
To find the end of the current day, you'll want to add a day to the date returned from startOfDayForDate
and then subtract one second.