Skip to content

Instantly share code, notes, and snippets.

@alissonperez
Forked from dflima/insert_time.py
Last active August 29, 2015 14:15
Show Gist options
  • Save alissonperez/f2b394c9e092a1911268 to your computer and use it in GitHub Desktop.
Save alissonperez/f2b394c9e092a1911268 to your computer and use it in GitHub Desktop.
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