You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem reading "expires_in" values from OAuthAccessToken jsons. The value comes as a Unix Epoch int from the service.
The code line at OAuthAccessToken.swift let expiresAt = (json["expires_in"] as? NSTimeInterval).flatMap(toNSDate)
If json["expires_in"] = 1475233174
Sets expiresAt value to: 2063-06-30 20:59:08 +0000 (this NSdate converted to UNIX epoch is 1475233174*2)
But if I change the converter to let expiresAt = NSDate(timeIntervalSince1970: (json["expires_in"] as? NSTimeInterval)!)
The expiresAt value is correct
What is the difference between .flatMap and NSDate() converters?
Should the json["expires_in"] be in another format?
Thanks
The text was updated successfully, but these errors were encountered:
I have a problem reading "expires_in" values from OAuthAccessToken jsons. The value comes as a Unix Epoch int from the service.
The code line at OAuthAccessToken.swift
let expiresAt = (json["expires_in"] as? NSTimeInterval).flatMap(toNSDate)
If json["expires_in"] = 1475233174
Sets expiresAt value to: 2063-06-30 20:59:08 +0000 (this NSdate converted to UNIX epoch is 1475233174*2)
But if I change the converter to
let expiresAt = NSDate(timeIntervalSince1970: (json["expires_in"] as? NSTimeInterval)!)
The expiresAt value is correct
What is the difference between .flatMap and NSDate() converters?
Should the json["expires_in"] be in another format?
Thanks
The text was updated successfully, but these errors were encountered: