V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
pyshu
V2EX  ›  Python

求 django-xadmin 时间格式设置的方法?

  •  
  •   pyshu · 2018-03-30 11:46:49 +08:00 · 1854 次点击
    这是一个创建于 2209 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我现在的 django-xadmin 的时间默认格式是 “ 2018 年 3 月 29 日 00:10 ”,但是我需要 “ 2018 年 3 月 29 日 00:10:xx ”,要加上秒。。。
    找了好久就是没找到,功力不够,哪个大神能指导下呢?
    2 条回复    2018-03-30 14:16:33 +08:00
    xpresslink
        1
    xpresslink  
       2018-03-30 12:51:33 +08:00
    在 settings 里加上
    # 配置自定义的日期时间格式
    DATETIME_FORMAT = 'Y-m-d H:i:s'
    DATE_FORMAT = 'Y-m-d'
    pyshu
        2
    pyshu  
    OP
       2018-03-30 14:16:33 +08:00
    @xpresslink 非常感谢大佬,我的问题已成功解决。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   976 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:20 · PVG 04:20 · LAX 13:20 · JFK 16:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.