推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
chendajun
V2EX  ›  Python

Python 时间格式化问题,抓取网页时候会遇到各种各样的时间格式(需要格式化成: yyyy-mm-dd hh:mm:ss),现在遇到一种格式就需要往里面添加正则。是否有好的解决办法?!

  •  
  •   chendajun · Oct 20, 2016 · 3521 views
    This topic created in 3681 days ago, the information mentioned may be changed or developed.
    7 replies  •  2016-10-20 18:59:37 +08:00
    slysly759
    slysly759
    Oct 20, 2016 via Android
    1
    你可以写一个通用时间轮子,然后坐等伸手党调用
    →_→
    yhxx
    yhxx
    Oct 20, 2016
    2
    (用 js 来转, new Date().getTime 解决)
    pixstone
    pixstone
    Oct 20, 2016
    3
    qiayue
    qiayue
    Oct 20, 2016
    4
    PHP 大法好 strtotime() 支持各种时间格式
    zxbin1990
    zxbin1990
    Oct 20, 2016
    5
    @qiayue 哈哈 :)
    guyskk
    guyskk
    Oct 20, 2016 via Android
    6
    arrow
    freestyle
    freestyle
    Oct 20, 2016 via iPhone
    7
    三楼 python-dateutil 轮子还支持多语言(包括中文)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2093 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 14:47 · PVG 22:47 · LAX 06:47 · JFK 09:47
    ♥ Do have faith in what you're doing.