We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16858
    • 58 Posts
    I have installed ModX and am really pleased with it! Good job programmers!

    I have looked through the configuration screen and various other places, but I cannot find where I can change the formatting of the date.

    How does one go about changing how dates are displayed on ModX?

    Bear with this poor newbie!
      • 7923
      • 4,213 Posts
      Each resource has it own way of doing it.. Most snippets has parameters to set the date format.. and many use strftime php function to output the date so they use locales too. What dates are we talking about?


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 16858
        • 58 Posts
        At the moment, I am talking about the backend, like creation date of web page, etc.

        Currently dates are in DD-MM-YYYY and I would like MM-DD-YYYY

        Petty, but it is confusing the way it is.

        Again let me say thanks to all you posters. Never have I belonged to a forum that quality answers were obtained so quickly.
          • 7923
          • 4,213 Posts
          Yes, our community is a special one wink

          Unfortunately the backend date formats are hardcoded currently.. You should create a feature request for to make it configurable in the bug tracker. If you really need those to be changed right now, and you like to change it everywhere, you should do a search for strftime (and strtotime) in these files (atleast):

          manager/actions/dynamic/
          - eventlog_details.dynamic.action.php
          - files.dynamic.action.php
          - mutate_content.dynamic.action.php
          - mutate_settings.dynamic.action.php
          - mutate_user.dynamic.action.php
          - mutate_web_user.dynamic.action.php

          manager/actions/static/
          - document_data.static.action.php
          - logging.static.action.php
          - messages.static.action.php
          - online_now.static.action.php
          - site_logging.static.action.php
          - site_schedule.static.action.php
          - sysinfo.static.action.php
          - welcome.static.action.php

          But if you want to change it only in document creating pages, look at mutate_content.dynamic.action.php and document_data.static.action.php


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The dates are in DD-MM-YYYY format because the original developer was Dutch, and that’s standard date format for Europe. I still occasionally get it backwards, and I moved out of the US almost 10 years ago.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 10746
              • 126 Posts
              My feeling is that BOTH of DD-MM-YYYY and MM-DD-YYYY should be deprecated...

              No website can EVER use EITHER of those without confusing somebody somewhere in the world, and anyone who says "but all my users are <insert-your-favourite-nationality> and will understand <insert-your-favourite-format>" just doesn’t get it...

              Personally I (try to) always use the international standard YYYY-MM-DD format for internal stuff and the 10-Jan-2007 format for external (ie viewable by passing humans) stuff.

              Cheers

              Gordon
                • 7923
                • 4,213 Posts
                Yes, but we could make it get the dateformat from user specific settings and default to a format defined in system configuration.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."