aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils/dates.py
blob: f094f72db0dccb5d6c412e44832b23146deb4468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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