import datetime
import sublime_plugin
class AddCurrentTimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("insert_snippet",
{
"contents": "%s" % datetime.datetime.now().strftime("#%Y-%m-%d %M%S%H %B %A the %W week, the %j day SZ")
}
)
#%X 等价于%H:%M:%S