# How can an admin set the datetime format?

**URL:** https://meta.discourse.org/t/how-can-an-admin-set-the-datetime-format/28006
**Category:** Support
**Created:** [April 27, 2015, 5:58pm UTC](https://meta.discourse.org/t/how-can-an-admin-set-the-datetime-format/28006 "2015-04-27T17:58:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [April 27, 2015, 5:58pm UTC](https://meta.discourse.org/t/how-can-an-admin-set-the-datetime-format/28006/1 "2015-04-27T17:58:11Z")

</div>

How can an admin specify the datetime format used by their Discourse installation? We’d like to standardize on ISO 8601 across all our webapps.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 30, 2015, 3:43am UTC](https://meta.discourse.org/t/how-can-an-admin-set-the-datetime-format/28006/2 "2015-04-30T03:43:47Z")

</div>

You can change the client-side ones with code in `</head>`:

```plaintext
<script>
I18n.translations.en.js.dates.time = "HH:mm"
I18n.translations.en.js.dates.long_with_year = "DD MMM YYYY HH:mm:ss"
I18n.translations.en.js.dates.long_date_with_year = "DD MMM YYYY HH:mm:ss"
I18n.translations.en.js.dates.long_no_year_no_time = "DD MMM YYYY"
I18n.translations.en.js.dates.long_with_year_no_time = "DD MMM YYYY"
</script>

```

Build the rest using [Moment.js | Docs](http://momentjs.com/docs/)

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [April 30, 2015, 1:45pm UTC](https://meta.discourse.org/t/how-can-an-admin-set-the-datetime-format/28006/3 "2015-04-30T13:45:12Z")

</div>

Thanks, but even when adding those changes you provided, I don’t see the new formats showing up anywhere in a new browser session. Looked on badge listings, the full date-time in a post’s “share” box, hover/tooltips, etc.

Is there anything to do other than adding them to the proper place in admin customizations?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 30, 2015, 8:04pm UTC](https://meta.discourse.org/t/how-can-an-admin-set-the-datetime-format/28006/4 "2015-04-30T20:04:32Z")

</div>

You need to do all of the formats. Put `I18n.translations.en.js.dates` in your browser console and expand the object to see the rest.

---

<div class="post-metadata">

### Author: ![mc0e](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@mc0e](https://meta.discourse.org/u/mc0e)
#### Post date: [July 26, 2015, 4:01pm UTC](https://meta.discourse.org/t/how-can-an-admin-set-the-datetime-format/28006/5 "2015-07-26T16:01:18Z")

</div>

> [@riking](#):
>
> You need to do all of the formats. Put I18n.translations.en.js.dates in your browser console and expand the object to see the rest.

There really are a **lot** of formats involved. Even pulling out a list of them from that object via the browser console is a daunting task.

riking, is it possible to give a simple guide to what’s involved with the momentjs stuff? Is there a path through this that someone who is not a javascript developer could follow?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:46pm UTC](https://meta.discourse.org/t/how-can-an-admin-set-the-datetime-format/28006/6 "2024-06-08T12:46:05Z")

</div>

This topic was automatically closed after 3329 days. New replies are no longer allowed.
