We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27733
    • 99 Posts
    Susan, I’m learning in trial-by-fire mode so please forgive my questions for what may be obvious ... So, the TV I mention uses the unixtime widget. I used this as it seemed the only way to get my own date field to jive with ditto. Is that not outputting a timestamp as I would think?
      ------
      Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You are correct. The date input type does not store a timestamp, as I thought it did. If you need a timestamp output, select the "Unixtime" widget. It will convert the date the "date" input stored in the database to a Unix timestamp that can then be parsed properly.
        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
        • 27733
        • 99 Posts
        Ahhh, I think I understand — so even though my TV already uses the unixtime widget, it is because it has input type "date" that it’s not parsable using strftime() via DateTime. However, I’m not sure how to deal with it. I need the date input type for front-end purposes so the user can use the calendar to input article dates. How can I get the TV data back into readable form (essentially reversing the effects of the unixtime widget)?
          ------
          Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          There should be something in the Repository for parsing timestamps.
          http://modxcms.com/DateTime-884.html
            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
            • 36592
            • 970 Posts
            Sorry for confusion... I didn’t want to see the code of DateTime snippet.
            I just wanted to see how you are calling DateTime snippet.
            Something like [[DateTime? ...]].
              • 36592
              • 970 Posts
              I think it should be ...
              [[DateTime? &timestamp=`[*articleDate*]`]]

                • 36592
                • 970 Posts
                How about non-cached form ?
                [!DateTime? &timestamp=`[*articleDate*]`!]

                  • 27733
                  • 99 Posts
                  Sweet! Thank you, that worked!
                    ------
                    Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.