skip to content
barorin&?

Pythonで現在日時を取得したいとき

/ 1 min read

Table of Contents

はじめに

Pythonで現在日時を取得する方法です。

方法

00.123456
import datetime
dt_now = datetime.datetime.now()
dt_now.strftime('%Y年%m月%d日 %H:%M:%S')
# 2021年08月01日 10:00:00