Re: [SMARTY] date_format

From: Date: Wed, 10 Sep 2003 09:18:59 +0000
Subject: Re: [SMARTY] date_format
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10187@lists.php.net to get a copy of this message
On Tue, Sep 09, 2003 at 01:37:26PM +0200, Nino Katic wrote: > Hi, > > I'm subtracting 2 timestamps (difference is 20 sec.) inside smarty > 2.6.0 RC1 like this: > > {assign var="foo" value="$date1-$date2"} > > after i make > > {$foo|date_format:"%H:%M:%S"} > > i get result of 20 HOURS?? > > Is this a bug or what? date_format doesn't work with low timestamps due to the ambiguity if it a strangely formatted date or a timestamp. also: date_format takes your current locale-settings into account so it is not really what you want to display time-distances (you may get +- a few hours). write your own little modifer for that or use {"H:i:s"|gmdate:$foo} or so. greetings messju > Nino

« previous php.smarty.general (#10187) next »