Skip to content

CsvProvider has no option to write dates without timezone information. #1072

@f4hy

Description

@f4hy

The CsvProvider can give inconstant results if one does not need exact times, but just dates and the file is written and read in a different timezone.

type DateProbmes = CsvProvider<"Name, Date\n myname, 2017/09/19">

If you write such a file in UTC timezone, it will be written to a file as

myname,2017-09-19T00:00:00.0000000-00:00

However if this file is then read somewhere in the US, it will give you some local time on 2017-09-18 !!

When reading the csv file, without looking at the file some other way, there will be no way to know what timezone the file was written in so using just objects returned using CsvProvider you can't know if you want the date 09-18 or 09-19.

If the CsvProvider had a method to write the file with only 2017/09/19 then it would be read as the correct day in all local timezones.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions