---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Date.prototype.toString()

The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone.

## Syntax

```js
toString()
```

### Return value

A string representing the given date.

## Description

The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between.

For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)"

The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`.

`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown.

- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString).
- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString).
- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString).
- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString).
