BingAds / BingAds-dotNet-SDK

Other
26 stars 41 forks source link

Report time parsing #68

Closed adrianjcalvert closed 5 years ago

adrianjcalvert commented 5 years ago

On generated reports all of the date fields in the header come down from Bing Ads in American format "m/d/yyyy" resulting in "String was not recognized as a valid DateTime." on machines with differing regional settings.

I've had a look around Bing Ads for a configuration element but can't see anything, now using DateTime.Parse(strReportTime, new CultureInfo("en-US")); to get around it

https://github.com/BingAds/BingAds-dotNet-SDK/blob/897ab411de6c54291b72d2f09e27935906b00058/BingAdsApiSDK/V12/Internal/Reporting/ReportHeader.cs#L119

https://github.com/BingAds/BingAds-dotNet-SDK/blob/897ab411de6c54291b72d2f09e27935906b00058/BingAdsApiSDK/V12/Internal/Reporting/ReportHeader.cs#L109

https://github.com/BingAds/BingAds-dotNet-SDK/blob/897ab411de6c54291b72d2f09e27935906b00058/BingAdsApiSDK/V12/Internal/Reporting/ReportHeader.cs#L89

Example csv headers data

"Report Name: My Account Performance Report" "Report Time: 1/1/2018,9/1/2018" "Time Zone: (GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London" "Last Completed Available Day: 9/27/2018 12:35:00 PM (GMT)" "Last Completed Available Hour: 9/27/2018 12:35:00 PM (GMT)" "Report Aggregation: Daily" "Report Filter: " "Potential Incomplete Data: true" "Rows: 8898"

qitia commented 5 years ago

Thanks for reporting this @adrianjcalvert I will look into it and provide fix ASAP.

qitia commented 5 years ago

@adrianjcalvert new version 11.12.7 should already fix it. Please try.