Sublime Forum

How to auto insert current date time in snippet

#1

I want create a snippet like bellow:
/**
* 2018-10-04
* ------------------------
*/
how to auto fill ‘2018-10-04’ , any variable does it ?

1 Like

#2

there’s no date field mentioned at https://github.com/guillermooo/sublime-undocs/blob/a571f5ba987176607f12bb141965bf4596775eeb/source/extensibility/snippets.rst#environment-variables

maybe that is why https://packagecontrol.io/packages/InsertDate was created.
see also
Easiest way to insert date/time with a single keypress?

2 Likes

#3

I added it using custom python plugin and file handling, you can check this video here: https://youtu.be/8Mzp16ZpPBc?si=CZhXIfk8j5vVI7FD&t=512

0 Likes