---
schema_version: "1"
id: 85e80f39119e0f3ab3de97838b96a8191d9132d1a9e6c750093030643f1c2c4f
title: Update Your Integrations for New Locale Formats
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/admin_locales_code_integrations.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.admin_locales_code_integrations.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f9728706b46474f40d905d750a7dd160256f8eb8049515048a3fc982df4eda0e
description: If you integrate data from external systems into Salesforce or if you send Salesforce data to external third parties, use locale-neutral formats whenever possible in the related code. When locale formats change, review the code that handles the affected formats.
products:
  - Salesforce Platform
  - Cross Cloud
release: "264"
---
# Update Your Integrations for New Locale Formats

If you integrate data from external systems into Salesforce or if you send Salesforce data to external third parties, use locale-neutral formats whenever possible in the related code. When locale formats change, review the code that handles the affected formats.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: all editions</td></tr></tbody></table>

Integration points can take many forms, including API calls to and from Salesforce. Also review processes that include exporting data into files, such as comma-separated values (CSV) files, and importing data from files into Salesforce.

Address, currency, date, datetime, integer, Name, and time formats can change when a user changes locales. Whenever possible, use standard locale-neutral methods to handle these types of data. In the absence of a standard method, update the code to accommodate the new formats.

Specific to migrating from Oracle’s Java Development Kit (JDK) formats to International Components for Unicode (ICU) locale formats, verify integrations that handle currency, date, datetime, integer, or time data.

If a third party calls into Salesforce programmatically, work with that party to test and update the process as needed when locale formats change. To search your Salesforce code, download the metadata. Then use a command-line interface such as [Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).

## Integration Example: Importing Dates

Let’s look at a simple example of how a change in a locale format can affect integrations.

In this example, we have a custom object, Conference, with two additional fields: `start_date_time` and `end_date_time`. To populate the Conference object, an Apex class fetches data using an external API. The class could also fetch the data from a CSV file, but in this example, we use an external API call.

The external API call returns a JSON object that contains this information. The datetime data is formatted using the JDK format for the English (United States) \[en\_US\] locale.

```
{
   "conferences": [{
       "name": "conference1",
       "start_date_time": "10/20/2021 10:00 AM",
       "end_date_time": "10/22/2021 05:00 PM"
   }, {
       "name": "conference2",
       "start_date_time": "11/21/2021 11:00 AM",
       "end_date_time": "11/24/2021 05:00 PM"
   }]
}
```

This Apex code inserts the conference records.

```java
// Mocking the sample response of API call
String jsonResponse = '{"conferences": [{"name":"conference1", "start_date_time":"10/20/2021 10:00 AM", "end_date_time":"10/22/2021 5:00 PM"}, {"name":"conference2", "start_date_time":"11/21/2021 11:00 AM", "end_date_time":"11/24/2021 05:00 PM"}]}';
 
Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(jsonResponse);
 
List<Object> conferences = (List<Object>) results.get('conferences');
 
for(Object conference: conferences) {
  Map<String, Object> conferenceDetails = (Map<String, Object>)conference;
 
  //Initialize object
  Conference__c confObject = new Conference__c (
  name = String.valueof(conferenceDetails.get('name')),
  start_date_time__c = datetime.parse(String.valueof(conferenceDetails.get('start_date_time'))),
  end_date_time__c = datetime.parse(String.valueof(conferenceDetails.get('end_date_time')))
  );
   
  //insert object                       
  insert confObject;
}
```

The `datetime.parse()` method uses the datetime format of the personal locale of the user that executes the code.

Let’s assume that the user’s personal locale is English (United States) \[en\_US\]. The JDK and ICU datetime formats for that locale differ.

- JDK short datetime format for en\_US: 10/20/2021 10:00 AM
- ICU short datetime format for en\_US: 10/20/2021, 10:00 AM

When the org uses JDK locale formats, this code runs successfully. When ICU locale formats are enabled, this code throws a parse error because the `start_date_time` and `end_date_time` values are missing the expected comma after the year.

This issue can also occur when data stored in Salesforce is passed to an external system using a locale-specific format, for example, when using a POST call. As with the example above, the personal locale of the user that executes the code determines the format of the data.

## Remediate Issues

To avoid these issues, use locale-neutral formats when receiving, passing, and processing data.

If you find an issue with data received from an external system, contact the sender to update the format of the source data. If you can’t contact the sender, update your code to convert the received data into a locale-neutral format before processing it.

#### See Also

- [Use Locale-Neutral Methods in Code](https://help.salesforce.com/s/articleView?id=xcloud.admin_locales_code_methods.htm&release=264.0.0&type=5 "Data formats can change based on the user’s locale, adoption of new standards, or updates to the standard locale formats. To avoid errors when a locale format changes, use standard methods to handle this data in your code. If your code formats the data using the user’s locale, apply the format after all other processing is complete.")
- [Example Code with Locale-Formatted Data](https://help.salesforce.com/s/articleView?id=xcloud.admin_locales_code_examples.htm&release=264.0.0&type=5 "Review examples of code that handles data that can be formatted based on the user’s locale. See how code can break when it relies on a specific format for dates, times, and currencies. And review examples of how to fix these issues by using standard methods for handling these types of data.")
- [_Salesforce Developer Center_: Apex](https://developer.salesforce.com/developer-centers/apex)
- [Adopt the ICU Locale Formats](https://help.salesforce.com/s/articleView?id=xcloud.icu_migration_how.htm&release=264.0.0&type=5 "The ICU locale format release update is available for all orgs. Review the high-level process to successfully migrate to the new International Components for Unicode (ICU) locale formats. Some of the formats differ from the ones provided by Oracle’s Java Development Kit (JDK). Understand how to determine the impact of changes on your org, and learn about the updates required to support the new formats.")