So ive read there is no feature in the Foundation package that outputs a date only object.
Ive tried variations seen in forum posts. One of them is like this.
But i am confused why the output is always 16:00:00 +0000 for the time instead of 00:00:00 +0000?
This is the code
Calendar.current.date(bySettingHour: 0, minute: 0, second: 0, of: Date())!
16:00:00 is 4PM. Instead of 12:00AM
When I run it in this site online swift playground https://online.swiftplayground.run/
i get this output 2023-02-26 23:00:00 +0000
I figure this could be because of timezone. But is there a way to get a date object where the value of time is midnight? 00:00:00?
Thoughts?