> ## Documentation Index
> Fetch the complete documentation index at: https://docs.less.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Date Math

> Add or subtract days, seconds, hours and more from date columns

You can use the Date Math tool to extract parts of date columns - such as a weekday or year. It is particularly helpful in combinations with others tools.

<Note>
  Note that our Syntax also supports date math calculations. See more in the [Syntax](/canvas/syntax) section.
</Note>

### Configuration

<Steps>
  <Step title="Column name">
    The Date Math tool will create a new column. Use this input to name it.
  </Step>

  <Step title="Date column">
    Select the Datetime column that you want to add/subtract a duration to/from
  </Step>

  <Step title="Select Unit">
    Select the unit you want to add/subtract to/from your date column. You can select one of the following:

    * Seconds
    * Minutes
    * Hours
    * Days
    * Months
    * Years
  </Step>

  <Step title="Number of units">
    <Tip>This input supports syntax, column references and parameters.</Tip>

    Input the number of units that you want to add/subtract from your date column. Simply put a **-** (minus) in front of the number of units to subtract instead of add.
  </Step>
</Steps>

### Example: Using syntax to add Days

In this example we want to add whatever is in the *simple\_int* column + 10 as days to the *datetime\_column* column. We simply select the *Days* unit and reference the *simple\_int* column + 10 to get the result we want.

<Frame>
  <img src="https://mintcdn.com/less-51/ZjPXJAIsRGCMglYF/images/tools/date-math/Example.gif?s=e7a312c9825b2f68bf52544504c55ccf" width="2000" height="1258" data-path="images/tools/date-math/Example.gif" />
</Frame>

This result is by each row. So for row 1, we add 11 days to the *datetime\_column* column. For row 2, we add 12 days to the *datetime\_column* column. And so on.

<Frame>
  <img src="https://mintcdn.com/less-51/ZjPXJAIsRGCMglYF/images/tools/date-math/Example.png?fit=max&auto=format&n=ZjPXJAIsRGCMglYF&q=85&s=cfe83eefe662aa7a11e00f3db0702a4c" width="2194" height="1556" data-path="images/tools/date-math/Example.png" />
</Frame>
