view raw
4thSpace 4thSpace - 1 year ago 277
Swift Question

What time/day format is list.dt using

I'm using the day forecast api at There is a parameter called list.dt. It gives a value in this format: 1406080800.

What format is that and how would I translate it to some human readable using functionality in Swift?


The date is most likely in unix time (see forecast5, which states that list.dt is the "Time of data forecasted, unix, UTC".

Using Swift, you can use NSDate(timeIntervalSince1970: dt) in order to convert this to a date. Then you can use standard NSDateFormatter to make it human readable.