---
schema_version: "1"
id: 4002fa71bd1ad2587d455e3ef0156539a643754bbadc4943209a53b88d6d6d4f
title: parseDateTime()
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-parsedatetime.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-parsedatetime.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a87f348c3b048004ed49e66d286731b543abe751ac66ebca75621ef7091e94f9
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# parseDateTime()

Parses a string and returns a JavaScript Date.

## Signature

`parseDateTime(string dateTimeString, string parseFormat, string | boolean locale, boolean strictParsing)`

## Parameters

**_dateTimeString_:** Type: `string`. A datetime string.

**_parseFormat_:** Type: `string`. An optional Java format string used to parse the datetime. The default is from the `$Locale` global value provider.

**_locale_:** Type: `string | boolean`. This parameter is deprecated.

**_strictParsing_:** Type: `string`. Set this optional parameter to `true` to turn off forgiving parsing and use strict validation.

## Returns

**Type: `Date`** Returns a JavaScript `Date` object, or `null` if `dateTimeString` is invalid.

