When writing code or documentation, having the current date formatted correctly can save you time and help keep your projects organized. In Visual Studio Code (VSCode), while there's no built-in functionality for inserting formatted dates like "Oct 12, 2024" directly, there are effective methods to achieve this. In this post, we’ll explore how to insert formatted dates using snippets and extensions in VSCode.
Step-by-Step Guide
/************ Current Date **************/
"Insert Current Date": {
"prefix": "currentDate",
"body": [
"${CURRENT_MONTH_NAME_SHORT} ${CURRENT_DATE}, ${CURRENT_YEAR}"
],
"description": "Insert the current date in Oct 10, 2024 format"
}
How to use it?
- Go to any file then write currentDate
- If auto suggestion not work press ctrl+space
Top comments (0)