zoukankan      html  css  js  c++  java
  • 1-20 时间操作

    In [1]:
    import time
    
    In [2]:
    print(time.time())
    
     
    1564400310.6156976
    
    In [3]:
    print(time.localtime(time.time()))
    
     
    time.struct_time(tm_year=2019, tm_mon=7, tm_mday=29, tm_hour=19, tm_min=38, tm_sec=30, tm_wday=0, tm_yday=210, tm_isdst=0)
    
    In [4]:
    print(time.asctime(time.localtime(time.time())))
    
     
    Mon Jul 29 19:38:31 2019
    
    In [7]:
    print (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()))
    
     
    2019-07-29 19:39:14
    
    In [8]:
    import calendar
    print(calendar.month(2017,11))
    
     
       November 2017
    Mo Tu We Th Fr Sa Su
           1  2  3  4  5
     6  7  8  9 10 11 12
    13 14 15 16 17 18 19
    20 21 22 23 24 25 26
    27 28 29 30
    
    
  • 相关阅读:
    [LeetCode] Convert Sorted Array to Binary Search Tree
    [LeetCode] Diameter of Binary Tree
    [LeetCode] Student Attendance Record I
    [LeetCode] Reverse String II
    [LeetCode] Missing Number
    [LeetCode] Intersection of Two Arrays II
    [LeetCode] Base 7
    Ubuntu中firefox设置成中文
    Linux中的查找命令find
    Ubuntu14.04安装配置Chrome浏览器
  • 原文地址:https://www.cnblogs.com/AI-robort/p/11636513.html
Copyright © 2011-2022 走看看