Created
July 19, 2014 01:40
-
-
Save hsigrist/b1f1ff77e8182d7541ba to your computer and use it in GitHub Desktop.
add date time
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 datetime, getpass | |
| import sublime, sublime_plugin | |
| class AddDateCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| self.view.run_command("insert_snippet", { "contents": "%s" % datetime.date.today().strftime("%d %B %Y (%A)") } ) | |
| class AddTimeCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| self.view.run_command("insert_snippet", { "contents": "%s" % datetime.datetime.now().strftime("%H:%M") } ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment