close

import datetime

today = datetime.date.today() #output: 2018-10-29

now = datetime.datetime.now() # output: 2018-10-29  11:12:03.7911055

year = now.year #output: 2018

month = now.month #output: 10

day = now.day #output: 29

hour = now.hour #output: 11

minute = now.minute #output: 12

second = now.second #output: 3

arrow
arrow
    文章標籤
    python datatime
    全站熱搜

    楓綺 發表在 痞客邦 留言(0) 人氣()