We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12352
    • 101 Posts
    Hi, I’ve set de server offset time to 7 hours, but it’s not showing in the resources, I still get the time of where the server is located, even when I make a new resource.

    Any ideas? Thanks!
      Don't believe anything you read on the net. Except this.
      • 14877
      • 110 Posts
      It’s not clear to me what purpose the server_offset_time is used for.

      I thought the following test would prove it does something:

      - set my server_offset_time to -1.5 (I live in a funny timezone -- Newfoundland, Canada!). Well I already
      had it set to that.
      - I defined a TV with an output-type of date and selected the option to use the current date if none supplied
      - associated it with a template
      - referenced the TV in a resource using that template without overriding the value (which had not been set anywhere)
      - logged into the front-end
      - the date-time that was displayed was the server time, not my local time

      Perhaps it will be used for something in the future?

      My thinking is that it setting makes no sense anyway. Different logged in users (or even me, when I’m traveling) may be in different time zones. This setting would only apply in a single time zone! It would make more sense for this setting to reflect the offset from UTC, though I suspect PHP code, since it runs on the server, could detect that anyway.

      Perhaps a per-user setting of timezone would solve the problem?
        __________________
        JRG
        • 25663 MODX Staff
        • 12,272 Posts
        I *think* it only affects the manager log and event log timestamps.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 26903
          • 1,336 Posts
          Isn’t it used in the calculations to do with publish times also I seem to remember, maybe wrong though.
            Use MODx, or the cat gets it!
            • 26931
            • 2,314 Posts
            Isn’t it used in the calculations to do with publish times also I seem to remember, maybe wrong though
            i think so too: createdon, pub_date etc.
              • 11076
              • 159 Posts
              Quote from: rthrash at Dec 20, 2010, 08:18 AM

              I *think* it only affects the manager log and event log timestamps.
              sounds weird.

              umm... ok then,
              first check your time-zone with "phpinfo()" or from the modx>manager>reports>system info>phpinfo() - view. check the timezone under the date section.

              then try setting the time-zone in the ’php.ini’ file.
              search for the line:
              date.timezone =
              and here’s the list of the valid available timezones: http://us2.php.net/manual/en/timezones.php
              for example: date.timezone = "America/Chicago"

              or try the .htaccess method , add..
              php_value date.timezone America/Chicago
              to the root ".htaccess" file.

              if i’m not wrong and i’m remembering it right, it should work only with php5 support.
              another thing to take in mind is, i realy don’t know how it affects on scheduled corn jobs
                Michael Shraibman( gOmp)  | Freelance Design & Development | wink  impossible is nothing...
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                You can also use the offset (it’s part of the $modx->config[] array) in your own snippets (for example, using a snippet to format a TV value). I usually only worry about it if the client’s location is in a radically different time zone than their server; for instance if I’m working on a site for a business in Switzerland and the server is in the US, I’ll set the offset and make use of it in snippets and plugins to coordinate the times with the client’s Swiss time. For something like my site where it doesn’t matter what time is used, I don’t worry about it.
                  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
                  • 14877
                  • 110 Posts
                  I hate to sound dense, but it still makes absolutely zero sense. Unless I’m losing my marbles (quite possible I suppose sad ), an absolute number simply cannot be used to represent the difference in clock time between a server and a random client -- one client (i.e. time-zone), sure.

                  That discussion aside (it’s probably a pointless one anyway), is it correct that the Server Offset Time is only used in the Manager (a.k.a. "Back-end")?

                  [Rant, feel free to ignore]
                  Even in the Manager it makes no sense. Take the first site I’m creating in MODx (converting to MODx): I’m doing it and am located in Canada. The volunteers who will update the site nominally live in Costa Rica. They are almost all "ex-pats" and visit their "home" countries frequently (U.S.A., U.K., Netherlands, Canada, etc.). Countries like Canada and the U.S.A. span multiple time zones... The server is (currently) located in the U.S.A.

                  The database server is a different computer than the web server and could, at least in theory, be in a different time zone...
                  [End Rant]
                    __________________
                    JRG
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Only the manager uses the server offset value; it is available for any custom code to use as well.

                    I live in Israel, my site is hosted in the US somewhere (I think). If I want to use my local time on my site for auto-publishing a resource, then I would set my server offset time so that instead of displaying the US time (where my server is) it will display my local time.

                    It’s not a big deal, really. It’s just for convenience, if it’s convenient for you to use it. For example, an event calendar for a Swiss-based site that’s hosted in the US or the UK would probably want to use it.
                      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
                      • 14877
                      • 110 Posts
                      Sorry Susan...

                      What you want to do is set a parameter that indicates what the server time is in some "absolute way". The most convenient is "UTC". Then when a time is displayed, it is, for example, relative to our somewhat old-fashioned "Greenwich Mean Time". Then every client, no matter where it is, can say:

                      Oh, the server is "UTC - 6. I’m UTC+3, so the server time is...".

                      Anything else is meaningless.
                        __________________
                        JRG