RestCode / WebApiProxy

MIT License
199 stars 91 forks source link

Sending dates in URL to the server swaps months and days #70

Open wolfen351 opened 8 years ago

wolfen351 commented 8 years ago

Hi there

If I send a DateTime object to the server representing 12 Jan 2015, the server interprets it as 1 Dec 2015. This happens if the server method accepts the datetime object directly.

I have noticed that the WebAPIProxy generates the url by just "xxxxx&myDate="+ myDate + "&xxxx"

Please can we change this, so the date is written in a way that C# MVC understands, but is unambigious.

Like ISO 8601 for example?

wolfen351 commented 8 years ago

I have done a little research and I think this might work

myDateParameter.UtcNow.ToString("o")
faniereynders commented 8 years ago

I am not finding time for this project. @wolfen351 do you want to be a co-admin?

wolfen351 commented 8 years ago

Sure

Sent from my Samsung device

-------- Original message -------- From: Fanie Reynders notifications@github.com Date: 14/01/2016 2:56 PM (GMT+04:00) To: faniereynders/WebApiProxy WebApiProxy@noreply.github.com Cc: wolfen351 github@wolfen.za.net Subject: Re: [WebApiProxy] Sending dates in URL to the server swaps months and days (#70)

I am not finding time for this project. @wolfen351 do you want to be a co-admin?

— Reply to this email directly or view it on GitHub.

faniereynders commented 8 years ago

@wolfen351 you should be able to contribute now.

wolfen351 commented 8 years ago

Ok I'll start cleaning up issues shortly

wolfen351 commented 8 years ago

Ok, we have 2 problems:

1) URL parameters need encoding 2) DateTime should be sent in a standard format, as to not lose data on the wire

faniereynders commented 8 years ago

@wolfen351 hit me up on Twitter