Skip to content

Instantly share code, notes, and snippets.

@jwt625
Created June 16, 2017 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwt625/59ba13c5ece6aee1f6352b7af3b37755 to your computer and use it in GitHub Desktop.
Save jwt625/59ba13c5ece6aee1f6352b7af3b37755 to your computer and use it in GitHub Desktop.
insert date and time in sublime
import sublime, sublime_plugin, time
class InsertDatetimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
sel = self.view.sel()
for s in sel:
# self.view.replace(edit, s, time.ctime())
self.view.replace(edit, s, time.strftime('D%Y%m%dT%H%M'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment