0

Im working with API which has this kind of date format: /Date(1538744710756+0200)/. Looks like it's numer of seconds since 1970 + timezone. Is this some known format? Maybe there is some built in way to convert it to Swift Date? I know how to do this by extracting values from string, but maybe there is some built in mechanism.

Damian Dudycz
  • 2,622
  • 19
  • 38
  • Using this initializer - https://developer.apple.com/documentation/foundation/date/1780353-init should give you the date if you pass the number as `Int` / 1000. That date gave me `2018-10-05 13:05:10 +0000` – Rakesha Shastri Oct 08 '18 at 06:44
  • [see this thread](https://stackoverflow.com/questions/206384/how-do-i-format-a-microsoft-json-date) – crazy_phage Oct 08 '18 at 06:46

0 Answers0