summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docu/language_definition.html4
-rw-r--r--example/templates/src/articles.html2
-rw-r--r--stupid_template_engine.php2
3 files changed, 4 insertions, 4 deletions
diff --git a/docu/language_definition.html b/docu/language_definition.html
index f4bbf52..c0f853b 100644
--- a/docu/language_definition.html
+++ b/docu/language_definition.html
@@ -538,10 +538,10 @@
<p>Decrements (i.e. substract 1) a variable (variable name given by parameter <code>var</code>).</p>
<h3 id="stdlib_date">ste:date</h3>
- <p>Formats a time using PHPs <a href="http://php.net/manual/en/function.date.php">date format [ext. Link]</a>. The format is given in the tag's content. You can specify a time (unix timestamp) using the <code>timestamp</code> parameter (defaults to the current time).</p>
+ <p>Formats a time using PHPs <a href="http://php.net/manual/en/function.strftime.php">strftime format [ext. Link]</a>. The format is given in the tag's content. You can specify a time (unix timestamp) using the <code>timestamp</code> parameter (defaults to the current time).</p>
<p>
Example:<br />
- <code><pre><![CDATA[<ste:date timestamp="1316357360">d. M. Y, H:i:s</ste:date>]]></pre></code>
+ <code><pre><![CDATA[<ste:date timestamp="1316357360">%d. %h. %Y, %H:%M:%S</ste:date>]]></pre></code>
Result:<br />
<code><pre><![CDATA[18. Sep. 2011, 16:49:20]]></pre></code>
</p>
diff --git a/example/templates/src/articles.html b/example/templates/src/articles.html
index c0db692..108a3b8 100644
--- a/example/templates/src/articles.html
+++ b/example/templates/src/articles.html
@@ -6,7 +6,7 @@
<ste:foreach_limit array="articles" value="article" max="3" counter="i">
<h3><ste:uppercase><ste:escape>$article[title]</ste:escape></ste:uppercase></h3>
<div class="author">Author: <ste:escape>$article[author]</ste:escape></div>
- <div class="date"><ste:date timestamp="$article[timestamp]">d. M. Y, H:i:s</ste:date></div>
+ <div class="date"><ste:date timestamp="$article[timestamp]">%d. %h. %Y, %H:%M:%S</ste:date></div>
<div class="article_content">
<ste:if>
<ste:cmp var_a="i" op="eq" text_b="0" />
diff --git a/stupid_template_engine.php b/stupid_template_engine.php
index 2be4f79..860067b 100644
--- a/stupid_template_engine.php
+++ b/stupid_template_engine.php
@@ -1282,7 +1282,7 @@ class STEStandardLibrary
static public function date($ste, $params, $sub)
{
- return @date($sub($ste), empty($params["timestamp"]) ? @time() : (int) $params["timestamp"]);
+ return @strftime($sub($ste), empty($params["timestamp"]) ? @time() : (int) $params["timestamp"]);
}
}