Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
現在、Pythonタイムモジュールを使用してタイムスタンプを作成しています。このコマンドを使用して文字列を作成しました
timestamp = time.strftime('%l:%M:%S')
ただし、これはフォーマットを12時間フォーマットで印刷します。これを24時間形式で実行して、8:52:53ではなく20:52:53として表示されるようにする方法はありますか?
ありがとう!
試す
timestamp = time.strftime('%H:%M:%S')
Pythonタイムモジュールに関する情報については、このリンクをチェックしてください
https://docs.python.org/3/library/time.html#time.strftime