# Javascript: DateFormField.setDateFormat Method

> Sets the date's format. For a certain DateFormField the format string should be one of the strings returned through the getSupportedDateFormats function. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date. When this date's format is an empty string, which is the default value, a default format is used depending on the culture set for the date field's text.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: DateFormField.setDateFormat Method
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdateformat-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdateformat-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdateformat-method/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdateformat-method/#description)
- [Syntax](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdateformat-method/#syntax)
- [Parameters](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdateformat-method/#parameters)
- [Examples](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdateformat-method/#examples)

---

## Nearby

- **Previous:** [Javascript: DateFormField.setDate Method](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setdate-method/llms.txt)
- **Next:** [Javascript: DateFormField.setEmptyWidth Method](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/setemptywidth-method/llms.txt)
