Localized date strftime in Django view

后端 未结 1 473
[愿得一人]
[愿得一人] 2021-02-01 13:31

I would like to send localized date in JSON from django view

Normal text translation via

ugettext

is OK

Following

相关标签:
1条回答
  • 2021-02-01 14:20

    Finally i used date filter from django templates:

    from django.template.defaultfilters import date as _date
    from datetime import datetime
    
    _date(datetime.now(), "d b, D")
    
    0 讨论(0)
提交回复
热议问题