This article explains what the Now() function is and provide examples of how it can be used with the binding syntax in smart templates.
Prerequisites
|
ImportantNow() isn't supported when distributing a default template to end-users via Library Configuration tab. |
What is the Now() function?
Now() is a function that returns the current date. Now() is very often used in together with FormatDateTime() function.
Now() logic
Syntax | {{Now()}} |
---|---|
Input | n/a |
Output | unformatted current date (e.g. '2025-02-03') |
Now() function examples
Example 1
Using Now() together with the FormatDateTime() function to show today's date formatted according to 'dddd d MMMM yyyy' for the "en-US" language. The binding is:
{{FormatDateTime(Now(),"dddd d MMMM yyyy","en-US")}}
Input | Today's date = 2020-11-12 |
---|---|
Output | "Thursday 12 November 2020" |
Example 2
Using Now() together with the Translate() function to show today's date formatted according to the 'DocumentLanguage' set in the User Profile. The binding is:
{{FormatDateTime(Now(), Translate("FormatLongDate", DocumentLanguage), DocumentLanguage)}}
Input |
Today's date = 2020-11-12 FormatLongDate = "ddd d MMMM yyyy" DocumentLanguage = "en-US" |
---|---|
Output | "Thu 12 November 2020" |
Comments
Article is closed for comments.