Created
June 19, 2013 18:01
-
-
Save dflima/5816416 to your computer and use it in GitHub Desktop.
Sublime Text plugin to insert current datetime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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