Bertverbeek4PS / bc2adls

Exporting data from Dynamics 365 Business Central to Azure data lake storage or MS Fabric lakehouse
MIT License
49 stars 20 forks source link

Resolve issue null SystemCreatedAt Timezone Offset #6

Closed Arthurvdv closed 1 year ago

Arthurvdv commented 1 year ago

When setting a Time Zone outside the UTC, the records with a null SystemCreatedAt receives a wrong DateTime.

image image

This PR append the offset of the Time Zone, so when this value gets converted back to UTC further on in the process , it's has the right value of 01 jan 1900.

    local procedure ConvertDateTimeToText(Val: DateTime) Result: Text
    ...
    begin
        // get default formatted as UTC
        Result := Format(Val, 0, 9); // The default formatting excludes the zeroes for the millseconds to the right.