This is a common scenario: we have a TV that uses the Date input type to allow us to click a Javascript calendar with a desired date, then we use a Ditto call to reference and format that date. This requires that the template variable uses the "Unixtime" widget, and that our Ditto tpl uses the [+date+] to display the formatted date.
E.g.
#Ditto Call:
[!Ditto?startID=`2` &dateSource=`myTV` &dateFormat=`%d-%b-%Y` &tpl=`myTpl`!]
#tpl:
<p>This record references [+date+]</p>
But the dates are wrong... specifically, it seems that the unix timestamps returned by the Unixtime widget are wrong... the TV stores a date like ’01-04-2010 00:00:00’, and it comes back in the formatted Ditto results as being 2006. The Unixtime widget changes ’01-04-2010 00:00:00’ to
1159686000, but it should be
1270105200 -- I’ve tested this using the strtotime() function. It seems like the code in
./manager/includes/tmplvars.format.inc.php
may be to blame. This is on a 1.0.2 install. Anyone else had this problem?