We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12584
    • 208 Posts
    I have Ditto outputting a number of documents and I am using &dateSource=`createdon` to output the date an article was created.

    However a document created on the 8th gets output as being done on the 9th.

    I dont think this has always been wrong I a wondering if something has been changed somewhere to cause this, the documents have the correct day on them when I check the resource data.

    Any ideas
      • 3749
      • 24,544 Posts
      Server offset time?

      Here’s one solution: http://modxcms.com/forums/index.php?topic=34055.0
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 12584
        • 208 Posts
        Thanks for the link I chnaged the cod however still shows the dat after it was created, I am not sure if it is a server offset time because the server time is 6 hours behind my time so if anything it should show a date tof the day before instead of a day later.

        I am guessing this is something unique to my install and not a common issue.

        Thanks again
          • 3749
          • 24,544 Posts
          Quote from: ian_m at Dec 10, 2010, 02:56 PM

          Thanks for the link I chnaged the cod however still shows the dat after it was created, I am not sure if it is a server offset time because the server time is 6 hours behind my time so if anything it should show a date tof the day before instead of a day later.

          I am guessing this is something unique to my install and not a common issue.

          Thanks again

          I think the link I provided above also shows a way to let you correct it with PHX when you display the date with Ditto.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 12584
            • 208 Posts
            I was able to fix it for me by changing the PHx plugin, more exactly the "phx.parser.class.inc.php" file.
            I had to change line 270 from:
            Code:

            $output = strftime($modifier_value[$i],0+$output);

            to:
            Code:

            $output = strftime($modifier_value[$i],($output + $modx->config[’server_offset_time’]));


            I hope that this helps anyone and I do suggest changing the actual plugin because I think that this is the proper way, or maybe add an option to do this...

            Well changing the code was ok but whatever I am meant to do with the phx/plugin is beyond my expertise. huh
              • 3749
              • 24,544 Posts
              Yes, that’s exactly what is suggested in the link.

              The PHX parser code should definitely be updated.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting