// CopyYears - snippet for MODx
// Automatically updating copyright date
// License GPL
// Written 04-2006
// &startYear - first year of notice
// defaults to current year
// [!CopyYears?startYear=`2005`!]
$spacer = " - ";
$now = date("Y");
$startYear = isset($startYear)? $startYear : $now;
$years = ($now > $startYear) ? $startYear.$spacer.$now : $now;
return "$years";
it was thanks to sottwell that it wasn’t working right in the first place! But, nice, useful beginning, we’ll be looking forward to seeing what you move on to do!


!
<?php
/**
* CopyYears
*
* Parameters:
* start - first year of notice defaults to current year
* spacer - the space string between start and current year
*
* [[!CopyYears? &startYear=`2011`]]
*/
$start = $modx->getOption('start', $scriptProperties, date("Y"));
$spacer = $modx->getOption('spacer', $scriptProperties, ' - ');
$now = date("Y");
$startYear = isset($startYear)? $startYear : $now;
$years = ($now > $start) ? $start.$spacer.$now : $now;
return $years;
© 2006 - [[yearecho]]
<?php $year = date('Y'); return $year; ?> <?php return time(); ?>
[[!time:date=`%Y`]]
Another alternative, is to create a simple, reusable snippet called time:
<?php return time(); ?>
And then use the date output filter:
[[!time:date=`%Y`]]