From 49e0753ef575eef9640b17c8c768b0c087f231f9 Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 4 Apr 2013 16:56:10 -0400 Subject: [PATCH] Show GMT time, 24-hour. --- cms/templates/edit_subsection.html | 2 +- cms/templates/overview.html | 2 +- common/lib/xmodule/xmodule/tests/test_date_utils.py | 2 +- common/lib/xmodule/xmodule/util/date_utils.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cms/templates/edit_subsection.html b/cms/templates/edit_subsection.html index 80385de829..c48787c34a 100644 --- a/cms/templates/edit_subsection.html +++ b/cms/templates/edit_subsection.html @@ -43,7 +43,7 @@

The date above differs from the release date of ${parent_item.display_name_with_default}, which is unset. % else:

The date above differs from the release date of ${parent_item.display_name_with_default} – - ${get_time_struct_display(parent_item.lms.start, '%m/%d/%Y at %I:%M %p')}. + ${get_time_struct_display(parent_item.lms.start, '%m/%d/%Y at %H:%M UTC')}. % endif Sync to ${parent_item.display_name_with_default}.

% endif diff --git a/cms/templates/overview.html b/cms/templates/overview.html index 04aae12f4a..b3162a111a 100644 --- a/cms/templates/overview.html +++ b/cms/templates/overview.html @@ -162,7 +162,7 @@
<% start_date_str = get_time_struct_display(section.lms.start, '%m/%d/%Y') - start_time_str = get_time_struct_display(section.lms.start, '%I:%M %p') + start_time_str = get_time_struct_display(section.lms.start, '%H:%M UTC') %> %if section.lms.start is None: This section has not been released. diff --git a/common/lib/xmodule/xmodule/tests/test_date_utils.py b/common/lib/xmodule/xmodule/tests/test_date_utils.py index 2b294e028f..de004107b3 100644 --- a/common/lib/xmodule/xmodule/tests/test_date_utils.py +++ b/common/lib/xmodule/xmodule/tests/test_date_utils.py @@ -15,7 +15,7 @@ def test_get_time_struct_display(): def test_get_default_time_display(): assert_equals("", date_utils.get_default_time_display(None)) test_time = time.struct_time((1992, 3, 12, 15, 3, 30, 1, 71, 0)) - assert_equals("Mar 12, 1992 at 03:03 PM", + assert_equals("Mar 12, 1992 at 15:03 UTC", date_utils.get_default_time_display(test_time)) diff --git a/common/lib/xmodule/xmodule/util/date_utils.py b/common/lib/xmodule/xmodule/util/date_utils.py index 3db44b3ee6..601c4cee42 100644 --- a/common/lib/xmodule/xmodule/util/date_utils.py +++ b/common/lib/xmodule/xmodule/util/date_utils.py @@ -6,11 +6,11 @@ def get_default_time_display(time_struct): """ Converts a time struct to a string representation. This is the default representation used in Studio and LMS. - It is of the form "Apr 09, 2013 at 04:00 PM". + It is of the form "Apr 09, 2013 at 16:00 UTC". If None is passed in, an empty string will be returned. """ - return get_time_struct_display(time_struct, "%b %d, %Y at %I:%M %p") + return get_time_struct_display(time_struct, "%b %d, %Y at %H:%M UTC") def get_time_struct_display(time_struct, format):