Learn Courses My Dashboard

How do I convert this type of time to the standard form?

Hey guys, I’m having a little trouble of trying to convert UNIX time to the standard time in Swift UI. This is the UNIX time given from the JSON API:


And when I place it in an online converter, I get this result:

Wed, 08 Dec 2021 00:13:57 GMT

This is the output that I would like to receive, but I don’t know how to convert it… Do any of you guys out there know? Any help at all will appreciated :slight_smile:

Harri :grinning_face_with_smiling_eyes:

Hey Harri, date/time conversion is always frustrating, try this post!

Since you’re using SwiftUI, you can also use the new formatter APIs available on Text and TextField elements.