代码示例:(标识:python_datetime_strftime_i)
python_datetime_strftime_i.py
import datetime

x = datetime.datetime.now()

print(x.strftime("%I"))
运行结果: