V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · 3172 views
    This topic created in 3477 days ago, the information mentioned may be changed or developed.
    7 replies    2016-10-20 18:59:37 +08:00
    slysly759
        1
    slysly759  
       Oct 20, 2016 via Android
    你可以写一个通用时间轮子,然后坐等伸手党调用
    →_→
    yhxx
        2
    yhxx  
       Oct 20, 2016
    (用 js 来转, new Date().getTime 解决)
    pixstone
        3
    pixstone  
       Oct 20, 2016
    qiayue
        4
    qiayue  
    PRO
       Oct 20, 2016
    PHP 大法好 strtotime() 支持各种时间格式
    zxbin1990
        5
    zxbin1990  
       Oct 20, 2016
    @qiayue 哈哈 :)
    guyskk
        6
    guyskk  
       Oct 20, 2016 via Android
    arrow
    freestyle
        7
    freestyle  
       Oct 20, 2016 via iPhone
    三楼 python-dateutil 轮子还支持多语言(包括中文)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3483 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 12:05 · PVG 20:05 · LAX 05:05 · JFK 08:05
    ♥ Do have faith in what you're doing.