We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12941
    • 87 Posts
    Ok, so I have tried to research how to fix this problem, but so far nothing has worked. I found some threads on this forum but most of them had not been posted in for a year. No working result had been found.

    All I want to do is create an archive for my blog, but it’s displaying the date as December 31st 1969.

    I have tested my server date, and it turns up the correct date. I have used the following code on this page.

    <?php
    	$time = time();
    	$year = date('Y',$time);
    	$month = date('m',$time);
    	$day = date('d',$time);
    	echo $day.' '.$month.' '.$year;
    ?>
    <?
    $dateFormat = '%B %e, %Y';
    $dateUnixTime = 'put the timestamp here';
    echo  strftime($dateFormat, (intval($dateUnixTime) ));
    ?>


    It returns:
    11 06 2009December 31, 1969
    (today’s date / weirdo date)

    Here are my calls:

    [[Ditto? &parents=`2` &summarize=`4` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1` &extenders=`summary,dateFilter`  &paginateAlwaysShowLinks=`1` &tagData=`documentTags`]]
    
    Showing [+start+] - [+stop+] of [+total+] Articles
    [+previous+]   [+pages+]   [+next+]
    
    [!Reflect? &parents=`2` &groupByYears=`1` &getDocuments=`1` &monthSortDir=`DESC` &dittoSnippetParameters=`parents:2` &showItems=`1` &dateSource=`pub_date`!]
    


    HELP!!!!

    I just need this to work. It seems like something so simple and yet I’ve spent the last 2 hours fumbling around in the dark. And please, if you need me to try anything technical I need full steps. I am not a php programmer so I am not used to any of this stuff.
      • 12941
      • 87 Posts
        • 36592
        • 970 Posts
        Try changing Reflect parameter to this...
        &dittoSnippetParameters=`parents:2|sortBy:pub_date`
          • 12941
          • 87 Posts
          YOU ARE A LIFESAVER!

          That works. And I am pretty sure I tried that before, but I must have not done it quite right.

          One other thing, I don’t need to show each of the posts. Can I just have it organize by year, and then show only the months underneath it? I’m not quite sure what code to put to achieve that.
            • 36592
            • 970 Posts
            Remove
            &showItems=`1`
              • 12941
              • 87 Posts
              Well, as it turns out, this is really just sorting by createdon date, not the published date, even though I have all of the params for that in my ditto call. Any idea why?
                • 20413
                • 2,877 Posts
                What works for me...
                Archive Page Ditto:
                &orderBy=`pub_date DESC` &dateSource=`pub_date`

                Reflect:
                &dittoSnippetParameters=`parents:2` &dateSource=`pub_date`
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower