janssenr / SendCloudApi.Net

A C#/.net wrapper for the SendCloud API
MIT License
6 stars 5 forks source link

DateTime problems and missing fields #8

Closed davidkdb closed 3 years ago

davidkdb commented 3 years ago

You should use DateTimeOffset instead of DateTime on all date fields returned.

These fields are actually DateTimeOffset fields from Sendcloud, but for some reason are treated as DateTime.

I made a test myself with RestAPI and with for example shipment I set the created_at to DateTimeOffset and it returned {08.03.2021 11:24:25 +01:00}. Your API returned {08.03.2021 10:24:25} that will be incorrect if the time zone is different from UTC. In general DateTimeOffset is better since we dont need to worry about time zone issues.

Also fields are missing. For example in Shipment the allowed_shipping_methods field is missing, and we need this.

janssenr commented 3 years ago

Added allowed_shipping_methods and some other Shipment properties So the missing fields should be solved.

Can you share your DateTimeOffset example with me? Because I get an error when using DateTimeOffset

davidkdb commented 3 years ago

I have sent you an email with our test program

davidkdb commented 3 years ago

Any news ?

davidkdb commented 3 years ago

Still waiting for a feedback

janssenr commented 3 years ago

I added the missing fields. Still looking into DateTimeOffset. But SendCloud returns the Date in UTC. So you can use parcel.DateCreated.ToLocalTime() to get the correct DateTime