datetime fun

This commit is contained in:
Vincent Cloutier 2022-11-25 15:51:58 -05:00
parent cd33053885
commit 625096f934

View file

@ -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,