---
schema_version: "1"
id: a65c840b52de0d6b999dc286cd150120d33093ca2e5803f061e88533553c5ba1
title: formatDateTimeUTC()
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-formatdatetimeutc.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formatdatetimeutc.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6eff06c1afd8287f4bd50b7e8e09619f29e43c3e386127f30cd6a7afcd3d6a45
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# formatDateTimeUTC()

Returns a formatted date time in UTC.

## Signature

`formatDateTimeUTC (string | number | Date date, string formatString, string locale)`

## Parameters

**_date_**

Type: `string | number | Date`

A datetime string in ISO8601 format , or a timestamp in milliseconds, or a `Date` object. If you provide a String value, use ISO 8601 format to avoid parsing warnings. If no timezone is specified, defaults to the browser timezone offset.

**_formatString_**

Type: `string`

Optional. A string containing tokens to format the given date. For example, `"yyyy-MM-dd"` formats 15th January, 2017 as "2017-01-15". The default format string comes from the `$Locale` value provider. For details on available tokens, see [Formatting Dates in JavaScript](https://developer.salesforce.com/docs/platform/aura-platform/js-cb/js-cb-format-dates.md).

**_locale_**

Type: `string`

Optional. A locale to format the given date. The default value is `$Locale.langLocale`. We strongly recommended that you use the locale value from `$Locale`. We fall back to the value in `$Locale.langLocale` if you use an unavailable locale.

## Returns

**Type: `string`** A formatted and localized date time string.

## Sample Code

```javascript
var date = new Date();
// Returns datetime in UTC in the format "Oct 9, 2015 4:00:00 PM"
$A.localizationService.formatDateTimeUTC(date);
```

