---
schema_version: "1"
id: 035ea5e9ede118e960ccaa851b31fb50223c8fbf8c8e1dd2c76e2f8d7e9d1199
title: toString()
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-2string.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-2string.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 27976434119345e4c626f95c0bbab07c8567ffe67bea2ab05926226bfd5aadc7
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# toString()

Converts a date to a string.

## Syntax

`toString(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 `date_to_string()`.

## Usage

This function must take a `toDate()` or `now(​)` function as its first argument.

## Example

```nolang
q = foreach q generate toString(now(​), "yyyy-MM-dd HH:mm:ss") as ds1;
```
