now Template Tag
Example
Add the current date:
<!DOCTYPE html>
<html>
<body>
<h1>{% now "Y-m-d" %}</h1>
</body>
</html>
Run Example »
Definition and Usage
The now tag inserts the current date and/or
time, according to the specified format.
Example
Add the current date and time:
<!DOCTYPE html>
<html>
<body>
<h1>{% now "Y-m-d G:i:s" %}</h1>
</body>
</html>
Run Example »
Syntax
{% now format %}
Parameters
| Value | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| format | Required. A string with any combination of these characters:
|