This site is being remade and I won't be updating this for a while. Expect a lot of broken links, design and functionality. If all goes well, things should be stable by the end of 2022. Thank you for understanding.

HomePostsSnippets

An ISO 8601 Date Snippet For VS Code

Published

I use this VS Code snippet to get granular times for my post’s front matter. Note that the +02:00 is my timezone SAST—use your own timezone. There’s no ${CURRENT_TIMEZONE} unfortunately.

"ISO Date": {
    "prefix": "iso8601",
    "description": "Outputs an iso8601 date (YYYY-MM-DDTHH:MM:SS+02:00)",
    "body": "${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}T${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}+02:00"
}

Just know that I don’t have the iso8601 spec so I can’t validate this. It would probably be under RFC 3339, but I’m too lazy to rename this and retain my muscle memory.