Skip to content

Configurable date format #249

@kirill533

Description

@kirill533

OData clients/servers deliver date differently. For example, https://services.odata.org/OData/OData.svc/Products
deivers field "updated" like this:
<updated>2020-05-07T12:41:26Z</updated> .

In case of Power BI, it works if the format of the date will be done the following way:

JsonWriter::writeValue

                $dateTime = new \DateTime($value, new \DateTimeZone('UTC'));
                $formattedDateTime = $dateTime->format('Y-m-d\TH:i:s');
                $this->writeCore($formattedDateTime, /* quotes */ true);

Current implementation in master is:

                $dateTime          = new \DateTime($value, new \DateTimeZone('UTC'));
                $formattedDateTime = $dateTime->format('U')*1000;
                $this->writeCore('/Date(' . $formattedDateTime . ')/', /* quotes */ true);

Could you please make it configurable?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions