当前位置:网站首页>Common usage of time library
Common usage of time library
2022-07-04 06:29:00 【Suyuoa】
time Kuo is python Library with built-in processing time , Now let me talk about its common usage
1 Pause for a few seconds time.sleep()
Show first 1, And then after 1 Show in seconds 2
import time
print(1)
time.sleep(1)
print(2)
2 return 1970 Floating point seconds to now time.time()
import time
a = time.time()
print(a)
print(type(a))
3 Enter a tuple and return a time character time.asctime()
import time
a = time.asctime((2021,8,31,14,31,50,0,0,0))
print(a)
print(type(a))
If no parameter is given, the current time will be returned
import time
a = time.asctime()
print(a)
print(type(a))
4 Entering a floating-point second will return a time character time.ctime()
import time
a = time.ctime(1630391743.9544106)
print(a)
print(type(a))
If no parameter is given, the current time will be returned
import time
a = time.ctime()
print(a)
print(type(a))
5 Entering a floating-point second will return a gmt Time time.gmtime()
import time
a = time.gmtime(1630391743.9544106)
print(a)
print(type(a))
If no parameter is given, the current value will be returned gmt Time
import time
a = time.gmtime()
print(a)
print(type(a))
6 Entering a floating-point second will return a local time time.localtime
import time
a = time.localtime(1630391743.9544106)
print(a)
print(type(a))
If no parameter is given, the current local time will be returned
import time
a = time.localtime()
print(a)
print(type(a))
边栏推荐
- uniapp 自定義環境變量
- 2022.7.3-----leetcode.556
- Is the insurance annuity product worth buying? Is there a hole?
- Invalid revision: 3.18.1-g262b901-dirty
- Internet of things protocol ZigBee ZigBee module uses the concept of protocol stack
- 测试岗的中年危机该如何选择?是坚守还是另寻出路?且看下文
- MySQL的information_schema数据库
- MySQL learning notes 3 - JDBC
- Yiwen unlocks Huawei's new cloud skills - the whole process of aiot development [device access - ESP end-to-side data collection [mqtt]- real time data analysis] (step-by-step screenshot is more detai
- How to implement lazy loading in El select (with search function)
猜你喜欢
Detailed explanation of common APIs for component and container containers: frame, panel, scrollpane
Yiwen unlocks Huawei's new cloud skills - the whole process of aiot development [device access - ESP end-to-side data collection [mqtt]- real time data analysis] (step-by-step screenshot is more detai
Matlab remainder
How to expand all collapse panels
HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)
Uninstall Google drive hard drive - you must exit the program to uninstall
注释与注解
C # symmetric encryption (AES encryption) ciphertext results generated each time, different ideas, code sharing
Design and implementation of redis 7.0 multi part AOF
C實現貪吃蛇小遊戲
随机推荐
Considerations for testing a website
The width of the picture in rich text used by wechat applet exceeds the problem
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
Leetcode question brushing record | 206_ Reverse linked list
MySQL learning notes 3 - JDBC
HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)
Nexus 6p downgraded from 8.0 to 6.0+root
Design and implementation of redis 7.0 multi part AOF
剑指 Offer II 038. 每日温度
C realize Snake games
MySQL information_ Schema database
2022.7.3-----leetcode. five hundred and fifty-six
APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
How to determine whether an array contains an element
手动对list进行分页(参数list ,当前页,页面大小)
740. Delete and get points
Invalid revision: 3.18.1-g262b901-dirty
The solution of win11 taskbar right click without Task Manager - add win11 taskbar right click function
MySQL installation and configuration
对List进行排序工具类,可以对字符串排序