- プログラム
# coding: utf-8
from datetime import datetime, timedelta, timezone
import time
for i in range(0, 7):
date = datetime.now(timezone(timedelta(hours=+9), 'JST')).strftime("%Y-%m-%d %H:%M:%S.%f")
print(date)
time.sleep(0.17)
- 実行結果
2020-08-13 04:03:58.874931
2020-08-13 04:03:59.045158
2020-08-13 04:03:59.215385
2020-08-13 04:03:59.385582
2020-08-13 04:03:59.555776
2020-08-13 04:03:59.725971
2020-08-13 04:03:59.896166