What is the Best Way to Add a Date in a Template?

What is the Best Way to Add a Date in a Template?

There are several ways to add a date in your templates. This entry will show you three options and their differences. If you're not familiar with templates, we advise you to watch the tutorials first.

Option 1: Add a Date Field

You can easily add a 4D date field in your template. You can select the format in the dialog box:

This option is not advisable if you're using templates in other languages. The database will only display the date in the language of your operating system.

Option 2: Use “UTI_GetLetterDate”

You can use the feature "UTI_GetLetterDate", which lets you define the language in order to display the date in the template's language (the month is written out). Using one variable only will display the current date. The second optional variable can display a database field. For example, this lets you print the invoice's date in the desired language.

Option 3: Use ”GEN_INSERT”

The command "GEN_INSERT" lets you add date and place. The first variable indicates which date to use: "letterdate" uses the date of the database record (e.g. the invoice), "currentdate" uses the current date. The second variable lets you add a language code, that is e.g. "de", "fr", "en", etc.

Comparison chart

The following chart shows the different options and the results, using a template in its English-language version.


[A23]
    • Related Articles

    • How do I add markers?

      This article has been machine translated. If you find any errors, we would be grateful if you could report them to translation@timesensor.com. Markers are used to record structured additional information in the master data sheet and to be able to ...
    • How Can I Add a Digital Signature?

      Adding your signature to timeSensor LEGAL is easy. Start by scanning it and saving the file on your desktop. Then, open any 4D template as a draft. In our example, we're using the letter template. Open the action menu at the bottom left and choose ...
    • How can I add and change accounts?

      This article has been machine translated. If you find any errors, we would be grateful if you could report them to translation@timesensor.com. This entry shows how to be able to independently maintain and update the chart of accounts stored in ...
    • How Can I Update the Date on an Unprinted Invoice?

      Whenever you create an invoice with timeSensor LEGAL, it will first show up in your list of "unprinted invoices". Even invoices that timeSensor LEGAL is set up to create automatically will first show up as "unprinted invoices". If you do not print ...
    • How Can I Add Several Printer Trays?

      You want to use specific paper for your invoices? This FAQ entry will show you how to assign different printer trays for various pages of your documents. In General Printer drivers are fairly complex. This method will work for many printers, but ...