当前位置:网站首页>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))
边栏推荐
- How to expand all collapse panels
- STM32 单片机ADC 电压计算
- Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
- 树形dp
- High performance parallel programming and optimization | lesson 02 homework at home
- STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
- 手动对list进行分页(参数list ,当前页,页面大小)
- 报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。
- 采用中微BATG135实现IIC数据/指令交互
- 1、 Relevant theories and tools of network security penetration testing
猜你喜欢

报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。

Impact relay jc-7/11/dc110v

JS execution mechanism

Tree DP

【无标题】

Download kicad on Alibaba cloud image station

如何避免 JVM 内存泄漏?

JS how to convert seconds into hours, minutes and seconds display

AWT introduction

How to realize multi account login of video platform members
随机推荐
Nexus 6p downgraded from 8.0 to 6.0+root
1、 Relevant theories and tools of network security penetration testing
Functions in C language (detailed explanation)
Distributed cap theory
Cloud native - SSH article that must be read on the cloud (commonly used for remote login to ECS)
Uninstall Google drive hard drive - you must exit the program to uninstall
2022.7.2-----leetcode.871
C语言练习题(递归)
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
手动对list进行分页(参数list ,当前页,页面大小)
Fast power (template)
Win10 clear quick access - leave no trace
24 magicaccessorimpl can access the debugging of all methods
The sorting in C language realizes the number sorting method from small to large
QT get random color value and set label background color code
How to use multithreading to export excel under massive data? Source code attached!
Overview of convolutional neural network structure optimization
FRP intranet penetration, reverse proxy
AWT常用组件、FileDialog文件选择框
Which water in the environment needs water quality monitoring