Post

Replies

Boosts

Views

Activity

WeatherKit or SwiftUI date formatting issues
Hello! Hope you had an amazing Dub Dub week. I am currently integrating widgets into my weather app. The widgets use WeatherKit to get the hourly forecast. I have issues formatting or displaying dates for the locations. When I display the date for 2 or more locations with different timezones, the hours displayed are local for the phone, not the location I'm grabbing the weather for. This is how I display the date. hour is the Forecast item from WeatherKit. Text(hour.date.formatted(date: .omitted, time: .shortened)) Example: Neither of the locations' time is 9:00. They are in different time zones with 10 hours difference, one should be different from the other.
1
0
1.1k
Jun ’23