How to Prepare Dates and Times for Salesforce Data Loader

A practical guide to formatting date and date/time values for Salesforce Data Loader: target formats, time zones, cleanup of messy text, and how to verify results.

Salesforce Data Loader imports and exports records from CSV files, and date columns cause many failed or silently wrong imports. A value that looks obvious to a person, such as 03/04/2026 or "March 4, 2026 9:30 AM", may be rejected, read in the wrong order, or moved by a time zone conversion. This guide explains what preparing these values involves, which formats to aim for, and how to check that nothing meaningful changed along the way.

What Preparing Dates for Data Loader Does to Your Text

Purpose: the goal is to turn every date or date/time value in your CSV file into one consistent, unambiguous text pattern that Data Loader can parse. The calendar meaning stays the same. Only the way it is written changes.

Input: date text taken from spreadsheets, exports from other systems, form submissions or free-form notes. This text often mixes separators, puts day and month in different orders, spells out month names, uses 12-hour clocks, or omits the time zone.

Output: a CSV column where each cell follows one documented pattern, such as a four-digit year, two-digit month and two-digit day separated by hyphens. Date/time values also carry the time and, ideally, an explicit time zone.

Scope: this is only about how values in date and date/time columns are written. Other columns, record matching and field mapping are separate tasks. One condition matters: Salesforce stores date/time values in a normalized form. The time zone attached to your text, or assumed for it, therefore decides which moment actually gets saved.

Date Fields vs. Date/Time Fields

Salesforce distinguishes two field types, and they need different preparation.

  • Date fields hold a calendar day only, such as a birthdate or contract start date. Prepare them as a plain date with no time portion.
  • Date/Time fields hold a specific moment, such as when a case was opened. Prepare them with a time and a clear time zone. Otherwise the stored moment depends on Data Loader's time zone setting.

Check the field type in your org's object settings before you transform the column. Mapping a date-only value to a date/time field, or the reverse, is a common source of unexpected results.

Target Formats to Aim For

Salesforce documents a list of date patterns that Data Loader accepts. The safest choice is the ISO 8601 style, written year-first, because it cannot be confused with other regional orders. The patterns below are written in Java-style notation: yyyy is the year, MM the month, dd the day, HH the hour on a 24-hour clock, mm the minutes, ss the seconds and SSS the milliseconds. The exact list of accepted patterns can vary between Data Loader versions, so confirm it against the documentation for the version you use.

Date field (pattern):        yyyy-MM-dd
Date field (example):        2026-03-14

Date/Time (pattern):         yyyy-MM-ddTHH:mm:ss.SSSZ
Date/Time (example, UTC):    2026-03-14T09:30:00.000Z
Date/Time (example, offset): 2026-03-14T09:30:00.000-0500

The values above are illustrative examples, not output verified against a specific org. The letter T is a literal separator between date and time. In the first date/time example, the trailing Z marks UTC. In the second, -0500 marks an offset five hours behind UTC. Both describe the same moment only if the clock times differ accordingly. Run a small test load to confirm which variant your setup accepts.

Data Loader also has a setting for European day-first order (dd/MM/yyyy). Without it, slash-separated dates are read month-first, as is common in the US. Choosing year-first ISO text avoids depending on this setting.

How Time Zones Affect the Stored Value

Data Loader has a time zone setting, which by default follows your computer's time zone. If a date/time value has no zone, it is interpreted in that setting's zone and then converted for storage. The same text can therefore be saved as a different moment when another person, on a machine set to another zone, loads it.

  • Add an explicit zone (Z or a numeric offset) to every date/time value whenever your source data tells you the original zone.
  • If the source gives no zone, decide on one deliberately, write it down, and set Data Loader's time zone to match before loading.
  • For date-only fields, watch for values that land one day early or late. This can happen when a date is treated as midnight in one zone and converted to another. Check sample records after a test load.

Step-by-Step Preparation

  • 1. Make a copy of the original CSV so you can always compare against the source text.
  • 2. Identify each date column and confirm whether its target Salesforce field is Date or Date/Time.
  • 3. Inventory the formats present in each column (for example: 3/14/2026, 14.03.2026, Mar 14 2026, 2026-03-14 9:30 PM).
  • 4. Resolve ambiguous day/month order using the source system's known convention, not by guessing value by value.
  • 5. Convert every value to the target pattern: yyyy-MM-dd for dates, a full ISO date/time with zone for date/time fields.
  • 6. Convert 12-hour times to 24-hour times (9:30 PM becomes 21:30).
  • 7. Leave empty cells empty rather than filling in placeholder dates.
  • 8. Save the file as plain CSV in UTF-8 and avoid reopening it in a spreadsheet program that might reformat the dates.
  • 9. Load a small batch first, then compare the stored values in Salesforce with the source text.

Extracting and Normalizing Dates from Messy Text

When dates are buried in longer text, or written in several styles, a pattern-matching step can pull them out and rewrite them. The Python snippet below is an illustrative, untested example. It finds a US-style month/day/year date in a string and rewrites it as yyyy-MM-dd. It assumes month-first order, so it would misread day-first sources.

import re
from datetime import datetime

US_DATE = re.compile(r"\b(\d{1,2})/(\d{1,2})/(\d{4})\b")

def to_iso_date(text):
    match = US_DATE.search(text)
    if not match:
        return None
    month, day, year = (int(g) for g in match.groups())
    # datetime() raises ValueError for impossible dates such as 2/30/2026
    return datetime(year, month, day).strftime("%Y-%m-%d")

# Example input:  "Signed on 3/14/2026 by the client"
# Intended output: "2026-03-14"

Keep two outputs separate when you extract: the normalized value that goes into the Data Loader column, and the original text. Keeping the original lets you audit any conversion and catch values the pattern skipped or misread.

Source text (example) | Field type | Prepared value (example) | Note
3/14/2026 | Date | 2026-03-14 | Month-first source assumed
14.03.2026 | Date | 2026-03-14 | Day-first source with dot separators
Mar 14 2026 9:30 PM EST | Date/Time | 2026-03-14T21:30:00.000-0500 | 12-hour time converted; zone kept as offset
2026-03-14 09:30 | Date/Time | 2026-03-14T09:30:00.000Z | Only correct if the source time was UTC

Avoiding Unintended Changes

  • Spreadsheet auto-formatting: spreadsheet programs often recognize date-like text when opening a CSV and rewrite it in a local display format on save. Edit date columns as text, or apply changes with a script or text editor.
  • Ambiguous order: a value like 03/04/2026 can mean March 4 or April 3. Settle the convention per source, never per cell.
  • Invisible characters: non-breaking spaces (U+00A0), zero-width spaces (U+200B) and a byte order mark (U+FEFF) at the start of the file can stop a value from matching the expected pattern even when it looks correct. Strip or replace them before conversion, and check the header row for a leading byte order mark.
  • Leading and trailing whitespace: " 2026-03-14" with a leading space is not the same text as "2026-03-14". Trim cells in date columns.
  • Two-digit years: a value such as 03/14/26 needs a deliberate century rule; do not let a tool pick one silently.

Verifying the Result

After a test batch, open several imported records in Salesforce and compare each date with the original source text. Pick records near midnight, at month and year boundaries, and on daylight saving transition dates, since time zone shifts show up there first. Also review Data Loader's error file for rows rejected because of date formatting, and fix the source pattern rather than editing individual rows by hand.

Gaps in This Guide

No version-specific evidence was available for this guide. It does not confirm the complete list of patterns your Data Loader release accepts, the exact wording or location of its settings, or how your org's user time zone interacts with a given load. Treat the formats and examples here as a starting point, and confirm them with the official documentation for your Data Loader version and a small test import.