Introduction
I use IntelliJ IDEA when writing this blog. It works well with Git and is convenient because it shows markdown previews. Since I have to write the date in the md header every time I write a blog post, and there doesn’t seem to be a shortcut for inserting dates, I tried creating a command to insert the date, using the following site as a reference. I hope this helps.
Is there a shortcut for inserting date/time in IntelliJ IDEA?
Setup Procedure
- Open “File” > “Settings…” from the menu

- Select “Editor” > “Live Template” > “HTML/XML” and click “+”
- Select Live Template
- Enter “date” in Abbreviation
- Enter “Insert date and time” in Description
- Enter “$date$” in Template Text
- Click Edit Variables button

- Enter “date” in Name
- Enter
date("yyyy-MM-dd'T'HH:mm:ss'+09:00'")in Expression - Click OK to close the dialog
- Click Define or Change and check “Everywhere”
- Click OK to close the dialog
- Type “date” in the code editor and press Enter. If the date “2022-09-04T05:59:04+09:00” is inserted, the setup is complete!
That’s all.
Conclusion
I will continue to share more IntelliJ IDEA tips if I find them!
