Skip to main content
Version: 1.1 (Latest)

FASTBCP_DATEFORMAT

Overview

The FASTBCP_DATEFORMAT environment variable lets you specify a custom format string for converting date values to strings in the output. When not set, FastBCP uses the default yyyy-MM-dd HH:mm:sszzz.

The format string follows .NET standard and custom date/time format patterns.

Syntax

Windows
$env:FASTBCP_DATEFORMAT = "yyyyMMdd"
Linux/macOS
export FASTBCP_DATEFORMAT=yyyyMMdd

Configuration

PropertyValue
TypeFormat string
Defaultyyyy-MM-dd HH:mm:sszzz
Applies toAll output formats that serialize date columns as strings (CSV, JSON, etc.)
SinceFastBCP 1.0
Auto-adaptive formatting

The date format is auto-adaptive based on the column type:

  • Date-only columns will always output as yyyy-MM-dd regardless of the format string
  • Timestamp/DateTime columns will output as yyyy-MM-dd HH:mm:ss even if a timezone token (zzz) is present in the format string
  • DateTimeOffset columns will include the timezone offset as specified

Format Examples

Format stringExample output
yyyy-MM-dd HH:mm:sszzz (default)2026-06-28 14:30:22+02:00
yyyy-MM-dd2026-06-28
yyyyMMdd20260628
dd/MM/yyyy28/06/2026
MM-dd-yyyy06-28-2026
yyyy/MM/dd2026/06/28
yyyy-MM-dd HH:mm:ss2026-06-28 14:30:22

Examples

Compact date format — no separators (PowerShell)

$env:FASTBCP_DATEFORMAT = "yyyyMMdd"

fastbcp -S myserver.database.windows.net `
-d MyDatabase `
-T dbo.MyTable `
--fileoutput "output.csv"

Output column value: 20260628

Compact date format — no separators (Linux/macOS)

export FASTBCP_DATEFORMAT=yyyyMMdd

fastbcp -S myserver.database.windows.net \
-d MyDatabase \
-T dbo.MyTable \
--fileoutput "output.csv"

Output column value: 20260628

Restore default ISO 8601 format

Windows
Remove-Item Env:FASTBCP_DATEFORMAT
Linux/macOS
unset FASTBCP_DATEFORMAT
Copyright © 2026 Architecture & Performance.