NetSuite: Date Today in Email Template
Date Today in Freemarker
If you want to add today's date in your NetSuite email templates, you can use the following freemarker tags:
- ${.now} - returns today's date in long format
- ${.now?date} - returns today's date in short format
See more built-ins for date formats here.
Arithmetic Functions
If you want to perform arithmetic functions with dates, you will have to first use the long built-in to convert dates to milliseconds. Once converted you can add and multiply milliseconds, then convert the value back using any of the following built-ins:
- number_to_date
- number_to_datetime
Example:
Goal: To add 10 days to current date.
Formula: ${((.now?date)?long + 10 * 1000 * 60 * 60 * 24)?number_to_datetime}
Entering the following in the text editor will allow you to compare today's date and the formula's result.
Formula: ${((.now?date)?long + 10 * 1000 * 60 * 60 * 24)?number_to_datetime}
Entering the following in the text editor will allow you to compare today's date and the formula's result.
Comments
Post a Comment