---
schema_version: "1"
id: cfc58b0a3d6d17eb8a588f33db5eb993fabe60617e962063522464f58b7d3559
title: date Functions
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/atf/guides/atf-rules-date-functions.md
canonical_url: https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-date-functions.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3548aaf585c10e5ed85a8f22cbcfc39aa573ee0bf4ba0436fcd119d1a901c2e6
products:
  - App Template Framework
  - analytics
---
# `date` Functions

Use `date` functions in rules to manipulate date values in asset JSON at runtime.

For instance, a `date` function can update date values to a standardized format. If a user enters a date value in the wizard, the `date` function can update the format at runtime.

## `format`

Parameters: `Date dateValue`, `String format`

Returns: `String`

Recursive: Not supported

Description: Returns a formatted string of the provided date/time value based on the provided format.

### Example

This function call:
```json
{
    "format": "${date:format('01/02/2022', 'yyyy/MM/dd')}"
}
```

Returns:

```json
{
    "format": "2022/01/02"
}

```

## `parse`

Parameters: `String dateValue`, `String format`

Returns: `Date`

Recursive: Not supported

Description: Parses the given date/time value based on the provided format.

### Example

This function call:
```json
{
    "parsedDate": "${date:parse('01/02/2022', 'yyyy/MM/dd')}"
}
```

Returns:

```json
{
    "parsedDate": "2022/01/02"
}

```

## `add`

Parameters: `Date dateValue`, `String field`, `int delta`

Returns: `Date`

Recursive: Not supported

Description: Performs date/time arithmetic on the provided dateValue on the provided valid date field (year, month, day, hour, minute, second, millisecond) using the delta value to increase or decrease the date field by.

### Example

This function call:
```json
{
    "addedDate": "${date:add('2022/01/03 14:22:00', 'year', 3)}"
}
```

Returns:

```json
{
    "addedDate": "2025/01/03 14:22:00"
}

```

## `now`

Parameters: None

Returns: `Date`

Recursive: Not supported

Description: Returns the current date and time.

### Example

This function call:
```json
{
    "rightNow": "${date:now()}"
}
```

Returns:

```json
{
    "rightNow": 1790715391598
}

```