Skip to content

Instantly share code, notes, and snippets.

@jwt625

jwt625/insertTime.py

Created Jun 16, 2017
Embed
What would you like to do?
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