# DateToString

> Kalipso Studio 6.1 documentation · https://doc.sysdevmobile.com/kalipso/6.1/documentation/expressions/functions/date-functions/datetostring
>
> DateToString formats a YYYYMMDD date as a string using a format built from YYYY, YY, MM and DD, such as YYYY-MM-DD or DD-MM-YYYY.

This Function returns a <_string_>, which is the specified _Date_ formatted with the specified _Format_.

### Parameters

* **Date** <_string_> - Date to be converted to the specified Format. This parameter must be in format YYYYMMDD.
* **Format** <_string_> - Choose one of the predefined options or combine YYYY, YY, MM, and DD. Where:
  * YYYY - 4 digits year.
  * YY – 2 digits year.
  * MM – Month.
  * DD – Day.

### Examples

* _Example 1_

DateToString("20120131", "YYYY-MM-DD")\
**Result** = 2012-01-31

* _Example 2_

DateToString("20120101", "MM-YYYY-DD")\
**Result** = 31-2012-01

* _Example 3_

DateToString("20120101", "DD-MM-YYYY")\
**Result** = 31-01-2012

* _Example 4_

DateToString("20120131", "YYYY/MM/DD")\
**Result** = 2012/01/31

* _Example 5_

DateToString("20120131", "YY/MM/DD")\
**Result** = 12/01/31
