python 获取当前年份,日,月,小时,分钟,秒

from datetime import datetime 

    def someMethod():

       currentSecond= datetime.now().second
       currentMinute = datetime.now().minute
       currentHour = datetime.now().hour

       currentDay = datetime.now().day
       currentMonth = datetime.now().month
       currentYear = datetime.now().year

datetime.now().microsecond



作者:静心_18e1
链接:https://www.jianshu.com/p/dceed7a93381
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。


版权声明:本文为ieeso原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。