https://gist.github.com/jordan-brough/4007432を使用して、崇高に動作するタイムスタンプを取得しましたが、時間は 7 時間ずれています。どうすればこれを修正できますか? タイムゾーンを設定する必要がありますか?
import sublime, sublime_plugin
from datetime import datetime
class TimestampCommand(sublime_plugin.TextCommand):
def run(self, edit):
stamp = datetime.utcnow().strftime("%m/%d/%y %H:%M %p - ")
for r in self.view.sel():
if r.empty():
self.view.insert (edit, r.a, stamp)
else:
self.view.replace(edit, r, stamp)