From 625096f934ef9f755d0eb06febe5c8fa6b56a92f Mon Sep 17 00:00:00 2001 From: Vincent Cloutier Date: Fri, 25 Nov 2022 15:51:58 -0500 Subject: [PATCH] datetime fun --- src/BirdsiteLive.Twitter/TwitterTweetsService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BirdsiteLive.Twitter/TwitterTweetsService.cs b/src/BirdsiteLive.Twitter/TwitterTweetsService.cs index 8b69ced..04e8550 100644 --- a/src/BirdsiteLive.Twitter/TwitterTweetsService.cs +++ b/src/BirdsiteLive.Twitter/TwitterTweetsService.cs @@ -140,7 +140,7 @@ namespace BirdsiteLive.Twitter string creationTime = tweet.GetProperty("content").GetProperty("itemContent") .GetProperty("tweet_results").GetProperty("result").GetProperty("legacy") - .GetProperty("created_at").GetString(); + .GetProperty("created_at").GetString().Replace(" +0000", ""); var extractedTweet = new ExtractedTweet { Id = Int64.Parse(tweet.GetProperty("sortIndex").GetString()), @@ -149,7 +149,7 @@ namespace BirdsiteLive.Twitter MessageContent = tweet.GetProperty("content").GetProperty("itemContent") .GetProperty("tweet_results").GetProperty("result").GetProperty("legacy") .GetProperty("full_text").GetString(), - CreatedAt = DateTime.Parse(creationTime), + CreatedAt = DateTime.ParseExact(creationTime, "ddd MMM dd HH:mm:ss yyyy", System.Globalization.CultureInfo.InvariantCulture), IsReply = false, IsThread = false, IsRetweet = false,