Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Parsing an ISO 8601 date string in Javascript
export function getPublishedAtDateString(iso8601DateString) {
if (!iso8601DateString) {
return '';
const date = new Date(Date.parse(iso8601DateString));
return date.toDateString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.