How to get on python current time?

This question already has an answer here:

  • How to get current time in Python? 27 answers

  •     import time
    
        now = time.strftime("%c")
    

    详情请参阅https://www.cyberciti.biz/faq/howto-get-current-date-time-in-python/


    from time import gmtime, strftime
    strftime("%a, %d %b %Y %H:%M:%S", gmtime())
    
    # Will output
    'Thu, 03 May 2017 16:21:01'
    

    为你的例子使用:

    from time import gmtime, strftime
    strftime("%y-%d-%mT%H:%M:%SZ", gmtime())
    2017-03-05T07:34:35Z
    
    链接地址: http://www.djcxy.com/p/40908.html

    上一篇: 在计算机上访问实时

    下一篇: 如何获得python当前时间?