diff options
| author | Tom Christie | 2013-03-05 17:50:28 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-03-05 17:50:28 +0000 |
| commit | c20ebe95f6707d63373d9c583e90bcbc6e021899 (patch) | |
| tree | 8c51d642ef180b37f6799a45ccced9b71665fb7c /rest_framework/utils | |
| parent | 6e7ddd579b6604d1b0d6da8e4d09762be4520e35 (diff) | |
| parent | 5e5cd6f7f7357d68d5c10500ec0379e49d679202 (diff) | |
| download | django-rest-framework-c20ebe95f6707d63373d9c583e90bcbc6e021899.tar.bz2 | |
Merge datetime formats
Diffstat (limited to 'rest_framework/utils')
| -rw-r--r-- | rest_framework/utils/dates.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/rest_framework/utils/dates.py b/rest_framework/utils/dates.py new file mode 100644 index 00000000..f094f72d --- /dev/null +++ b/rest_framework/utils/dates.py @@ -0,0 +1,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
\ No newline at end of file |
