---
schema_version: "1"
id: 399c3a4f5963f1bc096cbad7b452f97c436ad817a15e0b6b11c6f7f867965ee1
title: toISOString()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/ref-jsapi/ref-jsapi-auralocalizationservice-toisostring.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-toisostring.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b866d9d172260bf525a8ada7c9ad0ffa3863ec1b815f1c0c9b3daa1a8f25046c
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# toISOString()

Deprecated. Use `Date.toISOString()` instead.

## Signature

`toISOString(Date | T date)`

## Parameters

**_date_:** Type: `Date | T`. A `Date` object.

**_unit_:** Type: `string`. A datetime unit. Options are 'year', 'month', 'week', 'day', 'hour', 'minute', or 'second'.

## Returns

**Type: `Date`** An ISO8601 string.

