Storing updatedOn as UTC

22 views
Skip to first unread message

Warren Zhang

unread,
Apr 6, 2016, 4:49:18 PM4/6/16
to AdWords API Forum
Hey,

Looking at the code for OAuth2ProviderBase in the .NET library, it looks like the check for whether or not the access token is expiring compares against DateTime.Now. Would I ever run into any problems if I stored updatedOn as a UTC time and, say, the server's local timezone was set to >= UTC +1? 

Thanks,
Warren

Anash P. Oommen (AdWords API Team)

unread,
Apr 11, 2016, 3:20:44 AM4/11/16
to AdWords API Forum
Hi Warren,

Yes, the AdWords API .NET library assumes that UpdatedOn uses the same timezone as the server timezone. So if you use UpdatedOn in UTC and the server timezone is UTC+1, the library would always think that the token is expired.

Could you file a feature request on https://github.com/googleads/googleads-dotnet-lib/issues? I think the dates in general should be in UTC in OAuth classes; this is something we can address for an upcoming release.

Cheers,
Anash P. Oommen,
AdWords API Advisor.
Reply all
Reply to author
Forward
0 new messages