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

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

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

      • <bdo id='lMEZt'></bdo><ul id='lMEZt'></ul>
      <tfoot id='lMEZt'></tfoot>

        如何使用 Python 驗證特定的日期和時間格式

        How to validate a specific Date and Time format using Python(如何使用 Python 驗證特定的日期和時間格式)
        <legend id='nAc8U'><style id='nAc8U'><dir id='nAc8U'><q id='nAc8U'></q></dir></style></legend>

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

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

                1. <tfoot id='nAc8U'></tfoot>
                  本文介紹了如何使用 Python 驗證特定的日期和時間格式的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在編寫一個程序來驗證 XML 文件的某些部分.我要驗證的要點之一是日期時間格式.我已經在論壇上閱讀了有關使用 time.strptime() 的信息,但是這些示例對我來說不太適用,并且超出了我的專業知識.任何人都知道如何驗證以下內容.這是日期和時間必須采用的格式.

                  I am writing a program to validate portions of an XML file. One of the points I would like to validate is a Date Time format. I've read up on the forum about using time.strptime() but the examples weren't quite working for me and were a little over my expertise. Anyone have any ideas how I could validate the following. This is the format the date and time must be in.

                  2/26/2009 3:00 PM
                  

                  我確信有一些內置的并且非常簡單,但我找不到.非常感謝您之前運行過此操作并提出建議.

                  I am sure there is something built-in and very easy but I can't find. Many thanks if you've run by this before and have suggestions.

                  推薦答案

                  是的,你可以使用 datetime.strptime():

                  Yes, you can use datetime.strptime():

                  from datetime import datetime
                  
                  
                  def validate_date(d):
                      try:
                          datetime.strptime(d, '%m/%d/%Y %I:%M %p')
                          return True
                      except ValueError:
                          return False
                  
                  
                  print validate_date('2/26/2009 3:00 PM')  # prints True
                  print validate_date('2/26/2009 13:00 PM')  # prints false
                  print validate_date('2/26/2009')  # prints False
                  print validate_date("Should I use regex for validating dates in Python?")  # prints False
                  

                  這篇關于如何使用 Python 驗證特定的日期和時間格式的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)

                      <bdo id='BENgb'></bdo><ul id='BENgb'></ul>

                      <legend id='BENgb'><style id='BENgb'><dir id='BENgb'><q id='BENgb'></q></dir></style></legend>

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

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

                          1. 主站蜘蛛池模板: 亚洲 欧美 日韩在线 | 国产高清一二三区 | 91麻豆精品国产91久久久久久 | 色综合av | 亚洲国产精品99久久久久久久久 | 亚洲视频免费 | 欧美激情综合 | 久久视频精品 | 国产乱xxav| 亚洲国产第一页 | 亚洲欧美精品在线观看 | 国产精品一区二区久久久久 | 国产精品黄 | 黄色毛片在线看 | 成人自拍av| 成人在线精品视频 | 野狼在线社区2017入口 | 神马影院一区二区三区 | 久久大| 久久久久国色av免费观看性色 | 亚洲a视频| 久久黄色网 | 午夜资源| av网站免费在线观看 | 国产在线一区二区 | 久久综合久久自在自线精品自 | www.99re5.com| 国产激情视频 | 四虎影院在线播放 | 三级黄色片在线播放 | 亚洲精品一区二区在线观看 | 一区二区三区亚洲视频 | 国产精品一区2区 | 久久免费视频在线 | 中文字幕精品一区 | 日本在线网站 | 91精品国产91久久久久久丝袜 | jizz在线免费观看 | 久久综合一区 | 中文字幕一区在线观看视频 | 一级做a爰片性色毛片视频停止 |