Skip to content

Instantly share code, notes, and snippets.

@hsigrist
Created July 19, 2014 01:40
Show Gist options
  • Select an option

  • Save hsigrist/b1f1ff77e8182d7541ba to your computer and use it in GitHub Desktop.

Select an option

Save hsigrist/b1f1ff77e8182d7541ba to your computer and use it in GitHub Desktop.
add date time
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