# How to change date format?

**URL:** <https://discuss.openedx.org/t/how-to-change-date-format/3300>\
**Category:** Site Operations Help\
**Tags:** how-to\
**Created:** [September 27, 2020, 8:13am UTC](https://discuss.openedx.org/t/how-to-change-date-format/3300 "2020-09-27T08:13:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chack](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/chack/32/1246_2.png) [@Chack](https://discuss.openedx.org/u/Chack)\
**Post date:** [September 27, 2020, 8:13am UTC](https://discuss.openedx.org/t/how-to-change-date-format/3300/1 "2020-09-27T08:13:47Z")

</div>

Hello, how I can change date format?  
Example `Course starts - 1 oct. 2020 06:00 +06`.  
How to make `Course starts - 1.10.2020`  
Thanks

---

<div class="post-metadata">

**Author:** ![ehsan\_ahmadi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/ehsan_ahmadi/32/534_2.png) [@ehsan\_ahmadi](https://discuss.openedx.org/u/ehsan_ahmadi)\
**Post date:** [September 29, 2020, 6:19am UTC](https://discuss.openedx.org/t/how-to-change-date-format/3300/2 "2020-09-29T06:19:43Z")

</div>

In `/edx/app/edxapp/edx-platform/conf/locale/en/LC_MESSAGES/django.po` change below lines to desired date format

```auto
LONG_DATE_FORMAT
DATE_TIME_FORMAT
SHORT_DATE_FORMAT
TIME_FORMAT

```

for example:

```auto
msgid "LONG_DATE_FORMAT"
msgstr "%A, %B %d %Y"

```

then run below lines to create `.mo` file from `.po` file

```auto
python manage.py lms compilemessages
python manage.py cms compilemessages

```

and finally restart lms and cms by this command:

```auto
sudo /edx/bin/supervisorctl restart lms
sudo /edx/bin/supervisorctl restart cms

```

---

<div class="post-metadata">

**Author:** ![Surojit98](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/surojit98/32/5713_2.png) [@Surojit98](https://discuss.openedx.org/u/Surojit98)\
**Post date:** [June 3, 2021, 5:44am UTC](https://discuss.openedx.org/t/how-to-change-date-format/3300/3 "2021-06-03T05:44:41Z")

</div>

I tried this method but it didn’t work, I also tried other few ways:-  
1.) [edx-platform/lms/djangoapps/courseware/date-summary.py]  
Here, there is the “def date\_format(self)” method where I changed the return type into ‘%d %b %Y’, but it did not work.

2.) [edx-platform/common/djangoapps/util/date\_utils.py]  
There are DEFAULT\_SHORT\_DATE\_FORMAT = “%d %b, %Y”  
DEFAULT\_LONG\_DATE\_FORMAT = “%A, %d %B, %Y”  
DEFAULT\_DATE\_TIME\_FORMAT = “%d %b, %Y at %H:%M”  
but these also didn’t worked.

3.) [edx-platform/lms/djangoapps/courseware/context\_processor.py]  
Here, I changed “user\_language” from ‘pref\_lang’ to ‘en-gb’/‘en-GB’, as it gives format of “dd/MM/yyyy” & in “def user\_timezone\_locale\_prefs(request)” I made the same change of ‘user\_language’ but didn’t achived any desired result at all.

4.) [edx-platform/lms/static/edx-ui-toolkit/src/js/utils/date-utils.js]  
Here also I changed “var DEFAULT\_LANG” to ‘en-gb’, but same its not making any change. Here there is also a portion :  
var dateFormatEnum = Object.freeze({  
shortDate: ‘ll’, // example: Jan 01, 2016  
longDate: ‘LLLL’, // example: Friday, January 01, 2016  
time: ‘LTS z’, // example: 15:30:32 UTC  
defaultFormat: ‘ll HH[:]mm z’, // example: Jan 01, 2016 15:30 UTC  
defaultWithParen: ‘ll HH[:]mm (z)’, // example: Jan 01, 2016 15:30 (UTC)  
longDateTime: ‘dddd, ll HH[:]mm z’ // example: Friday, Jan 01, 2016 15:30 UTC  
});  
where I changed the “short date” format, which is passed as the type of format for date and in which I change it into ‘dd MMM YYYY’ but still no result is achieved.

I don’t know where the issue is prevailing, if you or anybody can sought-out it would be helpful.
