Home » Questions » Computers [ Ask a new question ]

how to insert the date and time with a shortcut in textmate?

how to insert the date and time with a shortcut in textmate?

I would like to insert the current date and time pressing a single key shortcut in TextMate. Any ideas how?

Asked by: Guest | Views: 453
Total answers/comments: 1
bert [Entry]

"For date type isoD and then hit tab to insert an ISO date. This is documented here. This is a ""snippet"" that is part of the ""Text"" bundle.

To see how this snippet works, hit Ctrl-Opt-Cmd S, expand Text, and select Current Date. You'll see that it is simply shelling out to the Unix date command. You can control the output format by modifying the existing format string or by creating your own snippet with a custom format string.

See the date(1) man page for usage info and strftime(3) for details on the format string.

E.g., for both date AND time, you could use

`date ""+%D %T""`"