0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

datetime その1

Posted at
import datetime

now = datetime.datetime.now()
print(now)
print(now.isoformat())
print(now.strftime('%d/%m/%Y-%H:%M:%S:%f'))
print('##########')

today = datetime.date.today()
print(today)
print(today.isoformat())
print(today.strftime('%d/%m/%y'))
print('##########')

t = datetime.time(hour=1, minute=15, second=30, microsecond=100)
print(t)
print(t.isoformat())
print(t.strftime('%H:%M:%S:%f'))
実行結果
2020-02-26 10:56:54.691417
2020-02-26T10:56:54.691417
26/02/2020-10:56:54:691417
##########
2020-02-26
2020-02-26
26/02/20
##########
01:15:30.000100
01:15:30.000100
01:15:30:000100
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?