mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-30 13:34:00 +03:00
14 lines
473 B
Python
14 lines
473 B
Python
|
def get_readable_date_format(date_format):
|
||
|
mapping = [("%Y", "YYYY"),
|
||
|
("%y", "YY"),
|
||
|
("%m", "MM"),
|
||
|
("%b", "[Jan through Dec]"),
|
||
|
("%B", "[January through December]"),
|
||
|
("%d", "DD"),
|
||
|
("%H", "HH"),
|
||
|
("%M", "MM"),
|
||
|
("%S", "SS"),
|
||
|
("%f", "uuuuuu")]
|
||
|
for k, v in mapping:
|
||
|
date_format = date_format.replace(k, v)
|
||
|
return date_format
|