We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26401
    • 247 Posts
    I’ve got an issue with formatting the date

    When I use getResource to pull a template with
    [[+tv.ivegotadate:date=`%Y\%m\%d`]]
    I get this date: 1969\12\31
    but when I use [[+tv.ivegotadate]], I get the right date.

    When I had[[*ivegotadate:date=`%Y\%m\%d`]] I got no data.
    I had set the date format through the output type:date, setting the output type to default fixed it for [[* but not for [[+tv.
    I would have thought that the output type and format would set the default format, not send as string.

    But it looks like getResource is not passing it correctly. Any idea why this might be?
      • 3749
      • 24,544 Posts
      Quote from: daspoda at Sep 22, 2010, 01:42 AM

      I’ve got an issue with formatting the date

      When I use getResource to pull a template with
      [[+tv.ivegotadate:date=`%Y\%m\%d`]]


      Try:

      [[+tv.ivegotadate:strtotime:date=`%Y\%m\%d`]]
        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
        • 26401
        • 247 Posts
        thanks that worked smiley
          • 27519
          • 275 Posts
          Quote from: BobRay at Sep 22, 2010, 03:00 AM
          Quote from: daspoda at Sep 22, 2010, 01:42 AM

          I've got an issue with formatting the date

          When I use getResource to pull a template with
          [[+tv.ivegotadate:date=`%Y\%m\%d`]]


          Try:

          [[+tv.ivegotadate:strtotime:date=`%Y\%m\%d`]]

          An answer from two years ago just made my day!
          Absolutely brilliant...
            MODx Revolution / MAMP / OS X
            • 3749
            • 24,544 Posts
            Glad I could help. smiley

            ------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using.
            MODX info for everyone: http://bobsguides.com/modx.html
              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
              • 36573
              • 173 Posts
              Quote from: skndn60 at Oct 04, 2012, 04:50 PM
              Quote from: BobRay at Sep 22, 2010, 03:00 AM
              Quote from: daspoda at Sep 22, 2010, 01:42 AM

              I've got an issue with formatting the date

              When I use getResource to pull a template with
              [[+tv.ivegotadate:date=`%Y\%m\%d`]]


              Try:

              [[+tv.ivegotadate:strtotime:date=`%Y\%m\%d`]]

              An answer from two years ago just made my day!
              Absolutely brilliant...

              3 Years and 1 month later and it still works. Isn't the internet great!
                Everything I know I learned on the internet. Saved me thousands in College tuition,