aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/aerc-templates.7.scd8
-rw-r--r--lib/templates/functions.go1
2 files changed, 9 insertions, 0 deletions
diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd
index c7bb0d1f..71042835 100644
--- a/doc/aerc-templates.7.scd
+++ b/doc/aerc-templates.7.scd
@@ -290,6 +290,14 @@ aerc provides the following additional functions:
{{.DateAutoFormat .OriginalDate.Local}}
```
+*now*
+ Return the current date as a golang time.Time object that can be
+ formated with *dateFormat*.
+
+ ```
+ {{dateFormat now "Mon Jan 2 15:04:05 -0700 MST 2006"}}
+ ```
+
*humanReadable*
Return the human readable form of an integer value.
diff --git a/lib/templates/functions.go b/lib/templates/functions.go
index 5d2f1928..0b0a4546 100644
--- a/lib/templates/functions.go
+++ b/lib/templates/functions.go
@@ -250,6 +250,7 @@ var templateFuncs = template.FuncMap{
"quote": quote,
"wrapText": wrapText,
"wrap": wrap,
+ "now": time.Now,
"dateFormat": time.Time.Format,
"toLocal": toLocal,
"exec": cmd,