Skip to content

Instantly share code, notes, and snippets.

@dflima
Created June 19, 2013 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dflima/5816416 to your computer and use it in GitHub Desktop.
Save dflima/5816416 to your computer and use it in GitHub Desktop.
Sublime Text plugin to insert current datetime
import sublime, sublime_plugin, datetime
class InsertTimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
date_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
for r in self.view.sel():
self.view.replace(edit, r, date_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment