We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4195
    • 398 Posts
    Use PHx date modifier (included with latest beta of ditto):

    <span class="myDayStyle">[+date:date=`%d`+]</span>
    <span class="myMonthStyle">[+date:date=`%b`+]</span>
    <span class="myYearStyle">[+date:date=`%Y`+]</span>
    


    Let me know if this helps wink
      Armand Pondman
      MODx Coding Team
      :: Jot :: PHx
      • 17717
      • 433 Posts
      bS,

      I can’t thank you enough, that worked great.

      Thanks again.

      Lee
        http://www.blend.uk.com | Web Design by Blend
        • 4195
        • 398 Posts
        Quote from: lw-d at Nov 21, 2006, 02:47 AM

        I can’t thank you enough, that worked great.

        Glad to be at service!

        Be sure to check PHP’s strftime documentation if you need more date "part" options.
          Armand Pondman
          MODx Coding Team
          :: Jot :: PHx
          • 17717
          • 433 Posts
          I have the date styled perfectly, however, the date always displays as 01 Jan 1970. Figured I may have messed up somewhere. Here is what I have so far:

          Call to ditto:

          [[Ditto? &startID=`6` &summarize=`2` &total=`2` &depth=`1 &dateSource:date=`%a` &dateSource:month=`%b` &tpl=`ditto_articles`]]
          


          ditto_articles Chunk:

          <div class="ditto_summaryPost">
          <a href="[~[+id+]~]">
          <h4 class"ditto_heading">[+title+]</h4>
          <div>[+summary+]</a></div>
          <p class="readmore">[+link+]</p>
          <div class="dottedline_x"></div>
          </div>
          
          <span class="myDayStyle">[+date:date=`%d`+]</span>
          <span class="myMonthStyle">[+date:date=`%b`+]</span>
          <span class="myYearStyle">[+date:date=`%Y`+]</span>
            http://www.blend.uk.com | Web Design by Blend
            • 4195
            • 398 Posts
            what does the value [+date+] return?
            if it doesn’t return a unix timestamp (ea. 1705474358) :date wil not work wink
              Armand Pondman
              MODx Coding Team
              :: Jot :: PHx
              • 17717
              • 433 Posts
              Hi bS,

              Yeah, that works fine, it outputs the following:

              17-Nov-06 23:02

              Thanks
              Lee
                http://www.blend.uk.com | Web Design by Blend
                • 18397
                • 3,250 Posts
                +date: should be whatever date field you want to use. Do not use date as it does not return a unix timestamp.
                  • 17717
                  • 433 Posts
                  Thanks Mark,

                  With help from bS, I got the date looking perfect, however, the date always displayed 01 Jan 1970. Does this suggest that I messed up somewhere?

                  Thanks
                  Lee
                    http://www.blend.uk.com | Web Design by Blend
                    • 18397
                    • 3,250 Posts
                    Which field are you using for your date? Can you copy and paste you Ditto tpl as well here? Thanks.
                      • 22815
                      • 1,097 Posts
                      I got 1 Jan ’70 when I was using the published date. That date gets blanked out upon publication. I recommend using a TV instead.
                        No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                        Forum: Where to post threads about add-ons | Forum Rules
                        Like MODx? donate (and/or share your resources)
                        Like me? See my Amazon wishlist
                        MODx "Most Promising CMS" - so appropriate!