Skip to content

Commit

Permalink
Fix parsing timestamps with a timezone attached
Browse files Browse the repository at this point in the history
Resolves discord-net#918.

For some reason (that i'm sure will bite me in the ass later), we
configured Json.Net with a time format that forced UTC - even when the
API appends a timezone to the timestamp. Removing the custom time format
seems to resolve this issue.
  • Loading branch information
foxbot committed Jan 7, 2018
1 parent fdd2c80 commit 9d77a3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Discord.Net.Rest/DiscordRestApiClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable CS1591
#pragma warning disable CS0618
using Discord.API.Rest;
using Discord.Net;
Expand Down Expand Up @@ -52,7 +52,7 @@ public DiscordRestApiClient(RestClientProvider restClientProvider, string userAg
_restClientProvider = restClientProvider;
UserAgent = userAgent;
DefaultRetryMode = defaultRetryMode;
_serializer = serializer ?? new JsonSerializer { DateFormatString = "yyyy-MM-ddTHH:mm:ssZ", ContractResolver = new DiscordContractResolver() };
_serializer = serializer ?? new JsonSerializer { ContractResolver = new DiscordContractResolver() };

RequestQueue = new RequestQueue();
_stateLock = new SemaphoreSlim(1, 1);
Expand Down

0 comments on commit 9d77a3c

Please sign in to comment.