Skip to content

Instantly share code, notes, and snippets.

@HereChen
Created June 9, 2014 15:03
Show Gist options
  • Save HereChen/aeceb19af45e022f94a6 to your computer and use it in GitHub Desktop.
Save HereChen/aeceb19af45e022f94a6 to your computer and use it in GitHub Desktop.
sublime: insert time
import datetime, getpass
import sublime, sublime_plugin
class InsertDatetimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("insert_snippet", { "contents": "%s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") } )
# self.view.run_command("insert_snippet", { "contents": "%s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S %a") } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment