日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > python >内容正文

python

Python 时间常用函数及结构

發(fā)布時(shí)間:2024/8/23 python 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Python 时间常用函数及结构 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
class time.struct_time 定義


The type of the time value sequence returned by gmtime(), localtime(), and strptime(). It is an object with a named tuple interface: values can be accessed by index and by attribute name. The following values are present:


Index ?| Attribute ? Values
---------------------------------------------------------------------
0 ? | tm_year ? ?(for example, 1993)
1 ? | tm_mon ? ?range [1, 12]
2 ? | tm_mday ? ?range [1, 31]
3 ? | tm_hour ? ?range [0, 23]
4 ? | tm_min ? ?range [0, 59]
5 ? | tm_sec ? ?range [0, 61]; see (2) in strftime() description
6 ? | tm_wday ? ?range [0, 6], Monday is 0
7 ? | tm_yday ? ?range [1, 366]
8 ? | tm_isdst ? ?0, 1 or -1; see below
N/A ? | tm_zone ? ?abbreviation of timezone name
N/A ? | tm_gmtoff ? offset east of UTC in seconds
---------------------------------------------------------------------


time.time()
Return the time in seconds since the epoch as a floating point number


time.gmtime([secs]) 0時(shí)區(qū)的時(shí)間
Convert a time expressed in seconds since the epoch to a struct_time in UTC in which the dst flag is always zero. If secs is not provided or None, the current time as returned by time() is used. Fractions of a second are ignored.?


time.localtime([secs]) 本地時(shí)間
Like gmtime() but converts to local time. If secs is not provided or None, the current time as returned by time() is used. The dst flag is set to 1 when DST applies to the given time.


time.mktime(t) ?與localtime()的功能恰好相反
This is the inverse function of localtime()


time.sleep(secs)
Suspend execution for the given number of seconds


time.strftime(format[, t])
Convert a tuple or struct_time representing a time as returned by gmtime() or localtime() to a string as specified by the format argument. If t is not provided, the current time as returned by localtime() is used. format must be a string. ValueError is raised if any field in t is outside of the allowed range.




Directive Meaning ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Notes
------------------------------------------------------------------------
%a ? ? ? ? ?Locale’s abbreviated weekday name. ?
%A ? ? ? ? ?Locale’s full weekday name. ?
%b ? ? ? ? ?Locale’s abbreviated month name. ?
%B ? ? ? ? ?Locale’s full month name. ?
%c ? ? ? ? ?Locale’s appropriate date and time representation. ?
%d ? ? ? ? ?Day of the month as a decimal number [01,31]. ?
%H ? ? ? ? ?Hour (24-hour clock) as a decimal number [00,23]. ?
%I ? ? ? ? ?Hour (12-hour clock) as a decimal number [01,12]. ?
%j ? ? ? ? ?Day of the year as a decimal number [001,366]. ?
%m ? ? ? ? ?Month as a decimal number [01,12]. ?
%M ? ? ? ? ?Minute as a decimal number [00,59]. ?
%p ? ? ? ? ?Locale’s equivalent of either AM or PM. (1)
%S ? ? ? ? ?Second as a decimal number [00,61]. (2)
%U ? ? ? ? ?Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0. (3)
%w ? ? ? ? ?Weekday as a decimal number [0(Sunday),6]. ?
%W ? ? ? ? ?Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0. (3)
%x ? ? ? ? ?Locale’s appropriate date representation. ?
%X ? ? ? ? ?Locale’s appropriate time representation. ?
%y ? ? ? ? ?Year without century as a decimal number [00,99]. ?
%Y ? ? ? ? ?Year with century as a decimal number. ?
%z ? ? ? ? ?Time zone offset indicating a positive or negative time difference from UTC/GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M represents decimal minute digits [-23:59, +23:59]. ?
%Z ? ? ? ? ?Time zone name (no characters if no time zone exists). ?
%% ? ? ? ? ?A literal '%' character.
---------------------------------------------------------------------------


time.ctime()
返回固定格式的本地時(shí)間

總結(jié)

以上是生活随笔為你收集整理的Python 时间常用函数及结构的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 亚洲国产精品无码久久 | 麻豆日产六区 | 少妇饥渴难耐 | 手机在线看片国产 | 人超碰 | 免费黄色av网址 | 毛片网页 | 91操视频 | 亚洲精选久久久 | 精品无码久久久久久国产 | 影音先锋成人资源网站 | 最色网站| 狠狠爱欧美 | 欧美黄色网络 | 中文字幕日韩三级 | 国产精品久久久久久人 | free性欧美69巨大 | 欧美性受xxxx狂喷水 | 自拍视频在线观看 | 欧美区一区二 | 国产精品久久欧美久久一区 | 日日摸夜夜添狠狠添久久精品成人 | 男女在线视频 | 欧美男人天堂 | 男女性网站 | 久久久久久久久久久久久久久久久 | 爱涩av | 黄视频网站在线看 | 丰满人妻一区二区三区大胸 | 日日噜噜噜夜夜爽爽狠狠 | 欧美性猛交xxxx黑人交 | 久久超| 国产精品无 | 亚洲精品20p | 午夜影院在线观看18 | 激情丁香网 | 国产美女www爽爽爽视频 | 天天操夜夜夜 | 少妇按摩一区二区三区 | 国产精品一区二区在线 | 超碰激情| 快色视频| 偷自拍| 91福利片 | 中日韩精品视频在线观看 | 亚洲裸体视频 | 青青草自拍偷拍 | 久久久精品一区二区 | 一区二区免费播放 | 天天插天天 | 女人被狂躁c到高潮喷水电影 | 国模一区二区三区 | 日韩欧美一区二区在线 | 无码h黄肉3d动漫在线观看 | 美女看片 | 成人自拍视频网 | 日本啪啪网 | 天堂网2018 | 三级免费观看 | 国产精品高潮呻吟久久久 | 狠狠躁日日躁夜夜躁av | 男女插插网站 | 国产精选第一页 | 毛片女人 | 亚洲一级Av无码毛片久久精品 | 国产高清成人久久 | 图书馆的女友在线观看 | 欧美理伦| 九九爱视频 | av黄网站| 亚洲网站一区 | 久草av在线播放 | 九九热国产在线 | 日韩黄色av| 日韩尤物 | 国产精品久久久久久白浆 | 九九在线观看视频 | 毛片毛片毛片毛片毛片毛片毛片毛片 | 波多野在线 | 欧美高清 | 亚洲性生活视频 | 欧美区在线 | 中文字幕第2页 | 卡通动漫亚洲综合 | 精品国产乱码久久久久久久软件 | 先锋影音av资源在线观看 | 男男全肉变态重口高h | 免费成人美女在线观看. | 日本美女全裸 | 狠狠v欧美v日韩v亚洲ⅴ | 国产美女精品一区二区三区 | 欧美1区2区3区 | 国产精品区二区三区日本 | 亚洲精品国产无码 | 欧美黄色图片 | 亚洲国产精品成人无码区 | 亚洲免费精品视频 | 最新中文字幕av专区 | 婷婷色基地 |