About this article
DateValue() is a function used for converting plain text dates into a date object for use in other date functions such as FormatDateTime(). This function is often used for taking dates from external systems such as Salesforce and making them usable with date functions in Templafy.
Prerequisites
|
Syntax
Syntax | {{DateValue(DateTime,Format,Region)}} |
Input | text |
Output | Date value as date type that is regionalized and formatted |
Example 1
Create a date object out of text, format and region.
Binding |
{{DateValue("Oct 22th, 2020","MMM d'th,' yyyy","en-US")}} |
||
Output | 2020-10-22(As a date object) |
Example 2
Take a date in text from an external system such as Salesforce and convert it to a date object.
Binding |
{{DateValue(HostSystem.Date,"MMM d'th,' yyyy","en-US")}} |
||
Input | "Oct 11th, 2020" | ||
Output | 2020-10-11(As a date object) |
Comments
0 comments
Article is closed for comments.