---
schema_version: "1"
id: 31c618901e3f29fd981aaa1f9fcfca68e6b262cc11ed2e3013dbeb4d133523f3
title: FORMAT ()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-soql-sosl/guides/soql-sosl/sforce-api-calls-soql-select-format.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-soql-sosl/guide/sforce-api-calls-soql-select-format.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1269ff5eb6caee1fa88cf547a812821b256bba358b4e81a42285ed88fb6f7e6f
products:
  - SOQL and SOSL Reference
  - Platform Developer Content
---

# FORMAT ()

Use `FORMAT` with the `SELECT` clause to apply localized formatting to standard and custom number, date, time, and currency fields.

When the `FORMAT` function is applied, fields reflect the appropriate format for the given user locale. The field format matches what appears in the Salesforce Classic user interface. For example, the date December 28, 2015 can appear numerically as 2015-12-28, 28-12-2015, 28/12/2015, 12/28/2015, or 28.12.2015, depending on the org’s locale setting.

In this example, dates are returned in ISO 8601 format such as 2025-04-10T22:31:37.000+0000.

```soql
SELECT lastModifiedDate FROM Opportunity
```

If lastModifiedDate is wrapped in FORMAT, the date returned is in the org or user's locale, such as 4/10/2025, 3:31 PM.

```soql
SELECT FORMAT(lastModifiedDate) FROM Opportunity
```

Using FORMAT with currencies returns a fully formatted value, such as \$44,000.00, instead of a plain number.

```soql
SELECT FORMAT(Amount) FROM Opportunity
```

The `FORMAT` function supports aliasing. In addition, aliasing is required when the query includes the same field multiple times. For example:

```soql
SELECT Id, LastModifiedDate, FORMAT(LastModifiedDate) formattedDate FROM Account
```

You can also nest it with aggregate or `convertCurrency()` functions. For example:

```soql
SELECT amount, FORMAT(amount) Amt, convertCurrency(amount) editDate, FORMAT(convertCurrency(amount)) convertedCurrency FROM Opportunity where id = '12345'
SELECT FORMAT(MIN(closedate)) Amt FROM opportunity
```
