https://kotlinlang.org logo
Title
c

Colton Idle

04/05/2023, 11:27 PM
I'm using the twitter api. I get a date back in this string format
"Sun Feb 25 19:31:07 +0000 2018"
How do I know what date format that is so I can convert it to a date, so that I can again format it into something human readable?
e

ephemient

04/06/2023, 12:25 AM
c

Colton Idle

04/06/2023, 5:14 AM
i wish there was a website where i could input a formatted date and it'd tell me what format it is. lol
e

ephemient

04/06/2023, 1:35 PM
there's really not that many standard date formats in use, https://www.rfc-editor.org/rfc/rfc3339 references ISO 8601 and RFC 2822
the 2822 format is pretty common across the web (with a variant in HTTP, https://www.rfc-editor.org/rfc/rfc2616#section-3.3) so it's pretty recognizable, I think
c

Colton Idle

04/06/2023, 2:41 PM
Gotcha. I guess my date above is 2822 but with a specific formatting of the date itself and maybe that's throwing me off?
e

ephemient

04/06/2023, 2:48 PM
I wonder if https://github.com/client9/snowflake2time still works… no idea, but it would be easier than parsing the date :p