21493 Posts in 5784 Topics by 2622 members
|Go to End|
12 November 2010 at 1:14am
in the Date-Class there is a method Ago().
But i guess its calculating not correct.
Today we have: 2010-11-11
In DB the date is: 2010-11-10
So, $datum.Ago should write "1 day ago" but I get "2 days ago".
Or am I understanding it wrong?
21 November 2010 at 3:21am
ok, i was using the wrong class.
$date = new Date();
But the method setValue() of the Date-Class is creating a Date in format "Y-m-d".
So hour, minute and second of $this->Created are considered as 00:00:00.
Instead I had to use the class SS_Datetime
$date = new SS_Datetime();
maybe this is useful for anyone.
One more notice: In german it should be formulated "vor 9 Tagen".
Mayby this is diffucult to do with translation, because "Tage" is the correct plural for "Tag".
But in this case it has to be "vor 9 Tagen".
|Go to Top|