How to format date in tpl-file

Posted on 2011-10-05
Last Modified: 2012-08-14

Have the included source, that display the date field like -> 2011-10-05 -> $row.event_from_date
But how do i format the date field to display -> 05.10.2011 ?

<div style="padding-top:2px; padding-left: 6px; padding-bottom:2px; padding-right:4px;">
    <br /> 
	{foreach item=row from=$singeltr_data}
		<span class="newshead_tilp"><b>{$row.event_title|stripslashes}</b></span><br/>
		<span class="newsdate">Startdato: {$row.event_from_date}</span><br />
		<a href='{$row.event_link}' >{lang mkey='more'}</a>
		<br/><br />


Open in new window

Question by:team2005
    LVL 17

    Expert Comment

    LVL 15

    Accepted Solution

    {$row.event_from_date|date_format:"%d/%b/%Y"} will give you o/p  as 28/Sep/2011

    {$row.event_from_date|date_format:"%d.%m.%Y"} will give you o/p  as 05.10.2011.
    LVL 2

    Author Closing Comment


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now