Format Dates Using Conga Collaborate Document Scripting
Format dates in Conga Collaborate with Document Scripting.
Collaborate gives you the ability to set how dates are displayed within Collaborate using the scripting method to_formatted_date(). Adjusting the different parameters sets dates to appear just as you want them in your documents or templates.
Just as with any document scripting method, use only lowercase letters for your variable names, and begin and end with the statement with {{double braces}}.
Available parameters:
- %A - displays the full day name (example: Saturday)
- %B - displays the full month name (example: May)
- %d - displays the day of the month as a number
- %m - displays the month as a number
- %y - displays the year
You can format dates in the following ways:
05/08/2017 {{opportunity_closedate.to_formatted_date("%m/%d/%Y")}}
In the example above, uppercase Y displays a four digit year. To display a two digit year, change the capital Y to a lowercase y.
05/08/17 {{opportunity_closedate.to_formatted_date("%m/%d/%y")}}
The above examples force a two digit month and day. To display single digit days and months when appropriate:
5/8/2017 {{opportunity_closedate.to_formatted_date("%-m/%-d/%Y")}}
You can also use hyphens instead of forward slashes as well as change the order in which the pieces of your date appear:
2017-05-08 {{opportunity_closedate.to_formatted_date("%Y-%m-%d")}}
Finally, if you want the full day, month, date, and year displayed:
Monday, May 8, 2017 {{opportunity_closedate.to_formatted_date("%A, %B %-d, %Y")}}