Commit | Line | Data |
---|---|---|
9b238bbd DH |
1 | <?php |
2 | /* | |
3 | * Smarty plugin | |
4 | * ------------------------------------------------------------- | |
5 | * Type: modifier | |
6 | * Name: epochal_date | |
7 | * Version: 0.23 | |
8 | * Date: December 12, 2010 | |
9 | * Author: Daniel Hromada | |
10 | * Purpose: let's consider the beginning of UNIX epoch to be more relevant to our current situation the birth of christ | |
11 | * Examples: {$smarty.now|epochal_date} | |
12 | * ------------------------------------------------------------- | |
13 | */ | |
dd026805 DH |
14 | function smarty_modifier_epochal_date($d) { |
15 | $date=smarty_make_timestamp($d); | |
9b238bbd | 16 | $year=date("Y",$date); |
dd026805 | 17 | return str_replace($year,$year-1970,date("d/m/Y",$date)); |
9b238bbd | 18 | } |
dd026805 | 19 | |
9b238bbd | 20 | ?> |