---
schema_version: "1"
id: 0d9a276b6cb54c72498fe9a8782e1734d49fd93d6e3e0f8ea270493e8ca004cf
title: date_to_string()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/reference/bi-saql-functions-date2string.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date2string.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6adad9c7608259ec2b5a1974e10369e2b41476c4baed339edc3722c4873f129e
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# date_to_string()

Converts a date to a string.

## Syntax

`date_to_string(date, formatString)`

For the allowed formats, see [Date Formats](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-date-formats.md).

**note:** This function is identical to `toString()`.

## Usage

This function must take a `toDate()` or `now(​)` function as its first argument.

## Example

```nolang
q = foreach q generate date_to_string(now(​), "yyyy-MM-dd HH:mm:ss") as ds1;
```
