---
title: "exDateformat"
canonical: "https://help.agiloft.com/space/HELP/284426265/exDateformat"
format: markdown
---
Dateformat() is used to display a date/time field in a particular format, often for localization. Dateformat() takes two arguments: the desired pattern format, and the field variable. Date time patterns are indicated with a series of letters that represent elements such as month, day in month, day of week, year, hour, and minute. For a full list of possible formats see [this page](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html) from Java about SimpleDateFormat().

#### Syntax

`dateformat("output pattern","$field")`

Some common date/time patterns include:

| ** Pattern** | **Example output** |
| --- | --- |
| "MM/dd/yy" | 05/31/16 |
| "yyyy/dd/MM" | 2016/22/09 |
| "MMMMM" | July (name of month) |
| "d" | 10 (day of month) |

#### Examples

The following results are expected when `$contract_start_date` evaluates to February 10, 2016 at 01:00:00.

| **Example formula** | **Output** |
| --- | --- |
| $formula(dateformat("d",$contract_start_date)) | 10.* Inserts which day of the month the contract starts.* |
| $formula(dateformat("MMMMM",$contract_start_date)) | February. *Inserts the full text name of the month.* |
| $formula(dateformat("yyyy",$contract_start_date)) | 2025. *Inserts the year of the contract start date.* |
| $formula(dateformat("MM/dd/yyyy hh:mm",NOW())) | *Inserts the current date and timestamp when the document template runs.* |