---
schema_version: "1"
id: 38080c7e0c73afcdf861ae397687c1ced76c42a75745d7644777e4c6c23fbb31
title: Use the DATEPARSE Function
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/c360_a_sl_calc_fields_dateparse_functions.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.c360_a_sl_calc_fields_dateparse_functions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 849024c76bdc900c661c28dcd118f696240384c5b94d2e05ab093bed47458c0c
description: The DATEPARSE function takes that string input and the user-specified format and returns a date field.
products:
  - Data 360
release: "264"
---
# Use the DATEPARSE Function

The DATEPARSE function takes that string input and the user-specified format and returns a date field.

Dates are stored in strings in various patterns (for example, `YYYY-MM-DD`, `DDMMMMYY`, and `MMM DD, YYYY`). When these fields are treated as strings, they lack the functionality of a field with a **Date** data type, such as date hierarchy drill-down, continuous dates, and manipulation of date parts.

If changing the data type from string to date doesn't work, use the `DATEPARSE` function to convert the field into a date data type. The syntax is `DATEPARSE("format", string)`.

- The format value is a hard-coded string based on the supported formats.
- The string value can be a field or a hard-coded value.

The format must be given to avoid mistakes such as reversing the month and day across different locales, such as:

`DATEPARSE("MMDDYYYY", "03112028")` outputs March 11, 2026.

`DATEPARSE("DDMMYYYY", "03112028")` outputs November 3, 2026.

The `DATEPARSE` function supports the formats mentioned in this table:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small " summary="Supported Formats for DATEPARSE Function">
        <caption>Supported Formats for DATEPARSE Function</caption>
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d8862e89">Unit of Time</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d8862e92">Format</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d8862e95">Sample Output</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Year</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>yy</p>
              <p style="margin-bottom:0;">y, yyyy</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>26</p>
              <p style="margin-bottom:0;">2026</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Quarter</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>Q/q</p>
              <p style="margin-bottom:0;">QQ/qq</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>2</p>
              <p style="margin-bottom:0;">02</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Month</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>M</p>
              <p>MM</p>
              <p>MMM</p>
              <p style="margin-bottom:0;">MMMM</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>9</p>
              <p>09</p>
              <p>Sep</p>
              <p style="margin-bottom:0;">September</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Standalone Month</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>L</p>
              <p>LL</p>
              <p>LLL</p>
              <p style="margin-bottom:0;">LLLL</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>9</p>
              <p>09</p>
              <p>Sep</p>
              <p style="margin-bottom:0;">September</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Week of the Year (1–53)</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>w</p>
              <p style="margin-bottom:0;">ww</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>1</p>
              <p style="margin-bottom:0;">47</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Day of the Month</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>d</p>
              <p style="margin-bottom:0;">dd</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">&nbsp;</td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Day of the Year</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>D</p>
              <p>DD</p>
              <p style="margin-bottom:0;">DDD</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>3</p>
              <p>25</p>
              <p style="margin-bottom:0;">143</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Local day of week (depends on locale)</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>e</p>
              <p>ee</p>
              <p>eee</p>
              <p style="margin-bottom:0;">eeee</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>1</p>
              <p>01</p>
              <p>Sun or Mon</p>
              <p style="margin-bottom:0;">Sunday or Monday</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Day of Week</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>E</p>
              <p>EE</p>
              <p>EEE</p>
              <p style="margin-bottom:0;">EEEE</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>Wed</p>
              <p style="margin-bottom:0;">Wednesday</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">
              <p style="margin-bottom:0;">Hour (12h) (1-12)</p>
            </td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>h</p>
              <p style="margin-bottom:0;">uh</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>8</p>
              <p style="margin-bottom:0;">08</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">
              <p style="margin-bottom:0;">Hour (24h) (0-23)</p>
            </td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>H</p>
              <p style="margin-bottom:0;">HH</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>8</p>
              <p style="margin-bottom:0;">15</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Minute</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>m</p>
              <p style="margin-bottom:0;">mm</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>8</p>
              <p style="margin-bottom:0;">08</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Second</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>s</p>
              <p style="margin-bottom:0;">ss</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>8</p>
              <p style="margin-bottom:0;">08</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">Fractional Second</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>S</p>
              <p>SS</p>
              <p>SSS</p>
              <p style="margin-bottom:0;">(up to six decimal places)</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p>2</p>
              <p>23</p>
              <p>235</p>
              <p style="margin-bottom:0;">(up to six decimal places)</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">ISO Year</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p>d</p>
              <p style="margin-bottom:0;">dd</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p style="margin-bottom:0;">ISO Year</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Unit of Time" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e89 ">ISO Week</td>

            <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e92 ">
              <p style="margin-bottom:0;">IW</p>
            </td>

            <td data-label="Sample Output" class="slds-cell-wrap" style="vertical-align:top;" headers="d8862e95 ">
              <p style="margin-bottom:0;">ISO Week</p>
            </td>

          </tr>
        </tbody>
      </table>

## Notes for Using the Formats

Inputs

- The format input must be hard-coded text within the function.
- Invalid inputs cause query failures rather than null output.
- Quarter inputs must be 1–4 or 01–04.
- Fractional seconds are supported up to six decimal places.
- Time zones are ignored.
- Local day of week `e` respects locale and what day of the week is considered as the start of the week, such as Sunday or Monday.

Year Behavior

- `yy` returns the two-digit year. For two-digit years under 70, the century is the 2000s, or 2000+yy. For two-digit years 70 and higher, the century is the 1900s, or 1900+yy.
- For standalone months (without a year specification) the default year is **0001**. This format differs from Tableau Classic, which defaults to 1900.

ISO Formats

- Avoid mixing ISO and non-ISO date parts, and avoid mixing ISO patterns. For example, use `IYYY IW` or `YYYY ww`, not `IYYY ww` or `YYYY IW`.
- Formats specifying ISO Year must also specify ISO Week. Without ISO Week, the Gregorian year is returned. This format differs from Tableau Classic, which returns the ISO year even without the week.

Unsupported formats that are available in Tableau Classic:

- **A**—milliseconds in a day aren't supported. Instead of dropping or rounding the time, `A` returns 00:00:00.
- **c**—standalone day of week. Using `c` causes errors and a query failure.
- **EEEEE/EEEEEE**—short weekdays (such as T or Tu) cause errors and a query failure, only up to `EEEE` is supported.
- **Y/YYY**—variations in ISO year formats aren't supported. Using `Y` or `YYY` causes errors and a query failure.

## Examples

`MM/dd/yyyy HH:mm:ss` → 09/22/2018 13:05:00

`ddMMMMYY` → 20February2021

2016-06-04T1430 → `YYYY-MM-dd'T'Hmm`