Insert current date or any date in Sublime Text with a simple command
Easily insert custom-formatted dates in your files.
All date format specifications follow the Python strftime syntax.
The following commands are provided in the command palette
InsertAnyDate: Today
which inserts the current date in the current file,format_out
settingInsertAnyDate: Custom Date
which requests the user an input date (format_in
setting) and inserts the it in the currentformat_out
settingAlternatively, hotkeys could be created:
// Insert always the date 2000-01-01
{
"keys": ["ctrl+alt+d"],
"command": "insert_any_date",
"args": {"date": "2000-01-01"}
},
// Insert the current date
{ "keys": ["ctrl+alt+t"], "command": "insert_any_date" },
// Prompt the user for a date to insert
{ "keys": ["ctrl+alt+y"], "command": "insert_any_date_prompt" }