We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21257 MODX Staff
    • 730 Posts
    strftime C library on Windows doesn’t support %s

    Dirty hack has been to replace line 920 in xpdoobject.class.php with
                                            if(!($format == '%s' && array_key_exists('windir', $_SERVER))) {
                                                $value= strftime($format, $ts);
                                            } else {
                                                $value= "$ts";
                                            }
    


    This assumes that the timestamp $ts passed in is already what you want out. Which begs the question why this method would even be called under these conditions. I’m sure I’m missing the point somewhere, but at least this has stopped my error log from filling up for now.

    For the Revo side of this coin, I will pose questions in a Revo thread.
      Mike Schell
      Lead Developer, MODX Cloud
      Email: [email protected]
      GitHub: https://github.com/netProphET/
      Twitter: @mkschell
      • 22303 MODX Staff
      • 10,725 Posts
      I don’t understand why this is causing errors. Can you explain the root of the problem here? I am well aware of %s not being supported on Windows, but just don’t use %s as the format huh
        • 21257 MODX Staff
        • 730 Posts
        Sorry for confusing things by dual-posting the issue in different categories - it was late tongue
        I will follow this up some more and work on the ticket for Revo.
          Mike Schell
          Lead Developer, MODX Cloud
          Email: [email protected]
          GitHub: https://github.com/netProphET/
          Twitter: @mkschell
          • 21257 MODX Staff
          • 730 Posts
          I guess what I was really wondering about xPDO in my haze was whether it should emulate the %s formatter, but it makes sense that it should be up to the caller to get things right and leave xPDO it’s lean mean self.
            Mike Schell
            Lead Developer, MODX Cloud
            Email: [email protected]
            GitHub: https://github.com/netProphET/
            Twitter: @mkschell