Skip to content

SaveCsv method ignoring supplied CultureInfo #7333

@totalgit74

Description

@totalgit74

System Information (please complete the following information):

  • OS & Version: Windows 10
  • Microsoft.Data.Analysis: 0.22.0
  • .NET Version: Net 6

Describe the bug
When using the SaveCsv method and passing in a CultureInfo object with the date format set (e.g. yyyy-MM-dd HH:mm:ss) the CSV file is saved with what looks to be the system settings, rendering the CultureInfo parameter useless.

To Reproduce

var ci = (CultureInfo) cultureInfo.Clone();
ci.DateTimeFormat.LongDatePattern = "yyyy-MM-dd";
ci.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd";
ci.DateTimeFormat.LongTimePattern = "HH:mm:ss";
ci.DateTimeFormat.ShortTimePattern = "HH:mm:ss";

frame.SaveCsv(<path>, cultureInfo: ci);

Expected behavior
DateTime values saved in the yyyy-MM-dd HH:mm:ss format.

Observed behavior*
DateTime values saved as d/MM/yyyy h:mm tt which is the ShortDatePattern and ShortTimePattern for the CultureInfo.CurrentCulture, thereby ignoring the passed in values.

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