We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21778
    • 223 Posts
    Hey guys! I have made an 40x43 "date box" inside my "news box". Currently ditto output date like this: 27-Apr-09 11:57

    So i need to format my [+date+] placeholder to look like the following picture (from my photoshop layout):



    Also, just a minor detail if its easy, can i get a placeholder with the publish time only? Since i only want to show date in my date box, so perhaps i could find another place for the time.

    I’m thinking i have to mess with dateSource and dateFormat, but i’m not sure how to do this

    Thanks!: )


    Edit.

    &dateSource=`createdon` &dateFormat=`%d.%m
    %y` Gives me some results! How do i make %y to output 2009 rather than 09 ?

      • 22770
      • 285 Posts
      Quote from: norlin at May 20, 2009, 04:44 AM


      Edit.

      &dateSource=`createdon` &dateFormat=`%d.%m
      %y` Gives me some results! How do i make %y to output 2009 rather than 09 ?


      Use %Y instead of %y.
        • 21778
        • 223 Posts
        Quote from: PatrickSamphire at May 20, 2009, 06:20 AM

        Quote from: norlin at May 20, 2009, 04:44 AM


        Edit.

        &dateSource=`createdon` &dateFormat=`%d.%m
        %y` Gives me some results! How do i make %y to output 2009 rather than 09 ?


        Use %Y instead of %y.

        Nice! I got it working! WOOT! smiley
          • 16278
          • 928 Posts
          can i get a placeholder with the publish time only
          Yes. But having used up your &dateSource/&dateFormat/[+date+] allowance, you’ll need to use PHx (already built in with Ditto) with createdon as a placeholder in your template. PHx has a modifer for date using the same formats as &dateFormat (http://www.php.net/strftime), so you can add this to your template:
          [+createdon:date=`%H%M`+]
          where you want the time to show up.
          8) KP