开发者

What date RFC does Twitter use?

开发者 https://www.devze.com 2023-01-01 00:00 出处:网络
Doc use : Tue Apr 07 22:52:51 +0000 2009 as an example. Can anyone ide开发者_如何学JAVAntify the rfc?

Doc use : Tue Apr 07 22:52:51 +0000 2009 as an example.

Can anyone ide开发者_如何学JAVAntify the rfc? Cheers


I can't say "there is no standard of that format" of course, because I very well may have just missed it. But when I started working with the Twitter API I did search for awhile to find the standard they are using and couldn't find a match. I ended up having to define a custom format (c#):

DateTime.ParseExact(twitterDateString,
                    "ddd MMM dd HH:mm:ss %K yyyy",
                    CultureInfo.InvariantCulture.DateTimeFormat);


Neither RFC 2822 nor RFC 3339 allow for separating the year from the month and day like that. If twitter was trying to be compliant, they blew it on the two most relevant IETF standards and on ISO 8601.


Convert dateTime Objet to RFC 3339

startDate = datetime(2019, 11, 1, 0, 0, 0, tzinfo=timezone.utc).isoformat('T')
endDate = datetime(2019, 12, 6, 0, 0, 0, tzinfo=timezone.utc).isoformat('T')
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号