Skip to content

DateFormatter doesRelativeDateFormatting has no effect on Windows #5226

Open
@zcohan

Description

@zcohan

Describe the bug
Setting the doesRelativeDateFormatting property on DateFormatter has no effect on Windows.

To Reproduce

let dateFormatter = DateFormatter()
dateFormatter.timeStyle = .short
dateFormatter.dateStyle = .long
dateFormatter.doesRelativeDateFormatting = true;
let formatted = dateFormatter.string(from: Date())

Expected behavior
On Mac, the formatted date is "Today at 7:35 pm".

Actual behavior
On Windows, the formatted date is ⁠"14 June 2025 at 7:35 pm".

Configuration (please complete the following information):

  • Swift Version: Swift version 6.1 (swift-6.1-RELEASE)
  • OS: Windows (Target: aarch64-unknown-windows-msvc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions