久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <small id='XxqUY'></small><noframes id='XxqUY'>

  1. <i id='XxqUY'><tr id='XxqUY'><dt id='XxqUY'><q id='XxqUY'><span id='XxqUY'><b id='XxqUY'><form id='XxqUY'><ins id='XxqUY'></ins><ul id='XxqUY'></ul><sub id='XxqUY'></sub></form><legend id='XxqUY'></legend><bdo id='XxqUY'><pre id='XxqUY'><center id='XxqUY'></center></pre></bdo></b><th id='XxqUY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='XxqUY'><tfoot id='XxqUY'></tfoot><dl id='XxqUY'><fieldset id='XxqUY'></fieldset></dl></div>

    <tfoot id='XxqUY'></tfoot>
      <bdo id='XxqUY'></bdo><ul id='XxqUY'></ul>
      <legend id='XxqUY'><style id='XxqUY'><dir id='XxqUY'><q id='XxqUY'></q></dir></style></legend>

    1. Python UTC 日期時間對象的 ISO 格式不包括 Z(祖魯語

      Python UTC datetime object#39;s ISO format doesn#39;t include Z (Zulu or Zero offset)(Python UTC 日期時間對象的 ISO 格式不包括 Z(祖魯語或零偏移))

    2. <tfoot id='2A25l'></tfoot>
        <tbody id='2A25l'></tbody>
      • <bdo id='2A25l'></bdo><ul id='2A25l'></ul>
      • <legend id='2A25l'><style id='2A25l'><dir id='2A25l'><q id='2A25l'></q></dir></style></legend>
      • <small id='2A25l'></small><noframes id='2A25l'>

        <i id='2A25l'><tr id='2A25l'><dt id='2A25l'><q id='2A25l'><span id='2A25l'><b id='2A25l'><form id='2A25l'><ins id='2A25l'></ins><ul id='2A25l'></ul><sub id='2A25l'></sub></form><legend id='2A25l'></legend><bdo id='2A25l'><pre id='2A25l'><center id='2A25l'></center></pre></bdo></b><th id='2A25l'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2A25l'><tfoot id='2A25l'></tfoot><dl id='2A25l'><fieldset id='2A25l'></fieldset></dl></div>

                本文介紹了Python UTC 日期時間對象的 ISO 格式不包括 Z(祖魯語或零偏移)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                為什么 python 2.7 不像 JavaScript 那樣在 UTC 日期時間對象的 isoformat 字符串的末尾不包含 Z 字符(Zulu 或零偏移)?

                Why python 2.7 doesn't include Z character (Zulu or zero offset) at the end of UTC datetime object's isoformat string unlike JavaScript?

                >>> datetime.datetime.utcnow().isoformat()
                '2013-10-29T09:14:03.895210'
                

                而在 javascript 中

                Whereas in javascript

                >>>  console.log(new Date().toISOString()); 
                2013-10-29T09:38:41.341Z
                

                推薦答案

                Python datetime 對象默認沒有時區信息,沒有它,Python 實際上違反了 ISO 8601 規范(如果沒有給出時區信息,則假定為當地時間).您可以使用 pytz 包 來獲取一些默認時區,或者直接子類化 tzinfo 你自己:

                Python datetime objects don't have time zone info by default, and without it, Python actually violates the ISO 8601 specification (if no time zone info is given, assumed to be local time). You can use the pytz package to get some default time zones, or directly subclass tzinfo yourself:

                from datetime import datetime, tzinfo, timedelta
                class simple_utc(tzinfo):
                    def tzname(self,**kwargs):
                        return "UTC"
                    def utcoffset(self, dt):
                        return timedelta(0)
                

                然后你可以手動將時區信息添加到utcnow():

                Then you can manually add the time zone info to utcnow():

                >>> datetime.utcnow().replace(tzinfo=simple_utc()).isoformat()
                '2014-05-16T22:51:53.015001+00:00'
                

                請注意,這符合 ISO 8601 格式,該格式允許 Z+00:00 作為 UTC 的后綴.請注意,后者實際上更符合標準,通常表示時區(UTC 是一個特例.)

                Note that this DOES conform to the ISO 8601 format, which allows for either Z or +00:00 as the suffix for UTC. Note that the latter actually conforms to the standard better, with how time zones are represented in general (UTC is a special case.)

                這篇關于Python UTC 日期時間對象的 ISO 格式不包括 Z(祖魯語或零偏移)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造python包)
                Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                How to refresh sys.path?(如何刷新 sys.path?)
                Distribute a Python package with a compiled dynamic shared library(分發帶有已編譯動態共享庫的 Python 包)

                    <i id='F3OpX'><tr id='F3OpX'><dt id='F3OpX'><q id='F3OpX'><span id='F3OpX'><b id='F3OpX'><form id='F3OpX'><ins id='F3OpX'></ins><ul id='F3OpX'></ul><sub id='F3OpX'></sub></form><legend id='F3OpX'></legend><bdo id='F3OpX'><pre id='F3OpX'><center id='F3OpX'></center></pre></bdo></b><th id='F3OpX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='F3OpX'><tfoot id='F3OpX'></tfoot><dl id='F3OpX'><fieldset id='F3OpX'></fieldset></dl></div>
                    1. <tfoot id='F3OpX'></tfoot>
                        <tbody id='F3OpX'></tbody>

                      • <small id='F3OpX'></small><noframes id='F3OpX'>

                        <legend id='F3OpX'><style id='F3OpX'><dir id='F3OpX'><q id='F3OpX'></q></dir></style></legend>
                          <bdo id='F3OpX'></bdo><ul id='F3OpX'></ul>
                          主站蜘蛛池模板: 毛片a级毛片免费播放100 | 国产欧美精品一区二区色综合朱莉 | 一区二区国产精品 | 欧美一级欧美一级在线播放 | 久久精品色欧美aⅴ一区二区 | 亚洲精品一区二区冲田杏梨 | 麻豆一区二区三区精品视频 | 国产农村一级片 | 超碰在线播 | 成人免费xxxxx在线视频 | 伊人精品久久久久77777 | 中文字幕 国产精品 | 欧美综合精品 | 久久久久国产一级毛片 | 欧美不卡视频一区发布 | 中文字幕99 | 亚洲超碰在线观看 | 在线免费观看亚洲 | 日韩精品一区二区三区视频播放 | 天天爽网站| 熟女毛片| 成人在线h | 久热免费| 久久国际精品 | 国产精品久久久久久久岛一牛影视 | 男人的天堂avav | 懂色av一区二区三区在线播放 | 少妇一级淫片免费放播放 | 亚洲三区在线观看 | 亚洲网在线 | 一级毛片免费完整视频 | 亚洲免费网站 | 亚洲精品自在在线观看 | 亚洲一区二区三区免费在线 | 日韩成人在线播放 | 一二三四在线视频观看社区 | 国产精品久久久久av | 亚洲精品日韩欧美 | 久久精品国产亚洲 | 久久天堂 | 日韩精品在线播放 |