When you generate documents in Baseline, dates show up in a default format like "September 14, 2023". But what if your documents need a short date like "09/14/2023", or just the day with an ordinal like "14th"? That's where the date() merge tag comes in.
You can take any date field stored on a loan and control exactly how it appears in your generated documents.
How It Works
The date() tag takes two inputs:
The field name (the date field on the loan, like "Origination" or "Maturity")
A format string (a pattern that tells the system how to display the date)
The syntax looks like this:
«date("Field_Name","format_string")»
So if your loan has an origination date of September 14, 2023, here's what different format strings would produce:
Merge Tag | Output |
| 09/14/2023 |
| September 14th, 2023 |
| 14th |
Date Fields You Can Format
Any date field in the system works inside a date() tag. Here are some of the ones you'll use most often:
Date Field | Field Name in Tag | Example Usage |
Origination Date | Origination |
|
Maturity Date | Maturity |
|
First Payment Date | First_Payment |
|
Paid Through Date | Paid_Through |
|
Next Payment Due | Next_Payment_Due |
|
Purchase Date | Address_Purchase_Date |
|
Current Date | Date |
|
💡 Tip: When formatting the current date (today's date), you only need one input: the format string. Example: «date("MMMM do, yyyy")». When formatting a date from a loan field, you need both the field name and the format string.
Format Tokens Reference
The format string is built from tokens: letter patterns that get swapped out for parts of the date. These are case-sensitive, so be careful. MM gives you the month, but mm gives you minutes.
Day
Token | What It Does | Example Output |
| Day of the month | 1, 2, ..., 31 |
| Day of the month, zero-padded | 01, 02, ..., 31 |
| Day with ordinal suffix | 1st, 2nd, 3rd, ..., 31st |
Month
Token | What It Does | Example Output |
| Month number | 1, 2, ..., 12 |
| Month number, zero-padded | 01, 02, ..., 12 |
| Short month name | Jan, Feb, ..., Dec |
| Full month name | January, February, ..., December |
Year
Token | What It Does | Example Output |
| Two-digit year | 23, 24, 25 |
| Four-digit year | 2023, 2024, 2025 |
Day of the Week
Token | What It Does | Example Output |
| Short day name | Mon, Tue, Wed, ... |
| Full day name | Monday, Tuesday, ... |
Common Format Examples
Here are some ready-to-use format strings for typical lending documents. All examples below assume the date is September 14, 2023.
What You Want | Format String | Result |
US short date |
| 09/14/2023 |
Short date, no leading zeros |
| 9/14/2023 |
Long formal date |
| September 14, 2023 |
Long date with ordinal |
| September 14th, 2023 |
Abbreviated month |
| Sep 14, 2023 |
ISO format |
| 2023-09-14 |
With full weekday name |
| Thursday, September 14th, 2023 |
Month and year only |
| September 2023 |
Just the day with ordinal |
| 14th |
Just the month name |
| September |
Just the year |
| 2023 |
Adding Plain Text Inside a Format String
Sometimes you need words mixed in with the date, like "the 14th day of September, 2023". To stop the system from treating those words as tokens, wrap them in single quotes.
For example:
«date("Origination","'the' do 'day of' MMMM, yyyy")»
This would output: the 14th day of September, 2023
The parts in single quotes ('the' and 'day of') show up exactly as written, while the tokens (do, MMMM, yyyy) get replaced with actual values from the date.
Things to Keep in Mind
Case matters.
MM= month (01-12).mm= minutes (00-59). Always use uppercaseMfor months and lowercaseyfor years.The field needs to have a date in it. If the date field on the loan is empty, the tag won't produce any output. Make sure the field is filled in before generating the document.
Custom date fields work too. If you've created a custom date field like "Extension_Date", you can format it the same way:
«date("Extension_Date","MM/dd/yyyy")»
📚 For the full list of merge fields available in the system, see List of Merge Fields.