Back to all How-tos

Add and Format the current date

This How-To will show you how to add the current date to your template, and to format it in the desired locale and language.

Because some jobs may take a long time to process, it’s important to consider that this method will generate the date at the time each record output is generated. This means a job that takes 4 hours to output and starts at 10:00PM will have (approximately) half its records indicating one date, the other half indicating the other.

Step 1: Add the date

Adding a date to the template is straightforward, thanks to our Insert Date dialog:

  • Click on Insert
  • Click on Date
  • To automatically update the date for the current one, check the Update Automatically option
  • Select the desired date format in the list
  • Click OK.

Step 2: Modify Locale

(This step is no longer necessary for Connect versions 1.5 and up.)

Unfortunately, the script added to automatically update the date does not load the locale set in the EditLocale dialog. This has to be done manually. Thankfully, there’s an easy way to fix this:

  • Double-click on the new “date” script added to the Scripts Pane
  • On line one, change new TextFormatter("en-US"); to new TextFormatter(locale);
  • Click OK to save.
Tags
Designer

Leave a Reply

Your email address will not be published. Required fields are marked *