question

Upvotes
Accepted
3 0 0 3

DateTimeOffset not implemented for ReportExtractionOperations.GetCompletedByDateRange()

I am writing C# code using the REST API SDK to download extractions that have completed in the last hour.

The code I was using was:

var completedExtractions = extractionsContext.ReportExtractionOperations.GetCompletedByDateRange(
startDate: DateTimeOffset.Now.AddMinutes(lookBackMinutes * -1),
endDate: DateTimeOffset.Now);

This code does not work for my time-zone (currently UTC+1:00). In order to get it to work I had to change DateTimeOffset.Now to DateTimeOffset.UtcNow. It appears that the time-zone info in the DateTimeOffset values is being ignored.

Is this my mistake or is the API incorrectly handling DateTimeOffset values?

tick-history-rest-apirest-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@dwinson

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

@dwinson

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
11.3k 25 9 14

Hi @dwinson,

I have found the same result. According to description of startDate and endDate in the REST API metadata, I understand the GetCompletedByDateRange endpoint supports only UTC date and time, so the function only works with the DateTimeOffset.UtcNow.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.