else/SublimeSnippets/timestamp.py

12 lines
348 B
Python
Raw Normal View History

2020-03-06 01:24:23 +00:00
'''
Thank you tpitale
https://gist.github.com/tpitale/11e5a2a152ec67a172f9
'''
import datetime
import sublime, sublime_plugin
class TimestampCommand(sublime_plugin.TextCommand):
def run(self, edit):
timestamp = "%s" % (datetime.datetime.now().strftime("%Y %m %d"))
self.view.insert(edit, self.view.sel()[0].begin(), timestamp)