Re: date_format and additional parms (not the number but the type)
| From: | Alain Fontaine | Date: | Thu, 29 Mar 2001 15:06:48 +0000 |
| Subject: | Re: date_format and additional parms (not the number but the type) | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-498@lists.php.net to get a copy of this message | ||
Hi,
If it doesn't handle mysql timestamps, change your SQL query so that it
returns the mysql timestamp as a unix timestamp:
select UNIX_TIMESTAMP(theTimeStamp) as theTimeStamp from myTable
And there you go.
> -----Message d'origine-----
> De : Andrei Zmievski [mailto:andrei@ispi.net]
> Envoye : jeudi 29 mars 2001 16:46
> A : Monte Ohrt
> Cc : Marc Logemann; smarty@lists.ispi.net
> Objet : [smarty] Re: date_format and additional parms (not the number
> but the type)
>
>
> On Thu, 29 Mar 2001, Monte Ohrt wrote:
> > You could use strtotime() to convert a string to a timestamp. It should
> > be able to figure it out if the string is a valid date. It should handle
> > mysql timestamps just fine too.
> >
> > {$date|strtotime|date_format}
>
> strtotime() will not handle MySQL timestamps.
>
> -Andrei
>
> "Science is like sex: sometimes something useful comes out,
> but that is not the reason we are doing it" -- Richard Feynman
>
> ---
> You are currently subscribed to smarty as: alain@nvision.lu
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/