facebook-csharp-sdk / simple-json

JSON library for .NET 2.0+/SL4+/WP7/WindowsStore with optional support for dynamic and DataContract
MIT License
380 stars 143 forks source link

date formats #34

Open hjvdwijk opened 11 years ago

hjvdwijk commented 11 years ago

Hi,

The library works very well. I had to make a tiny adjustment and added 2 date formats. Web.API converts SQL datetime and DateTime.Now in a string format that currently is not recognized. The following datatime format fixed this problem

    private static readonly string[] Iso8601Format = new string[]
                                                         {   @"yyyy-MM-dd\THH:mm:ss.FFFFFFFK",
                                                             @"yyyy-MM-dd\THH:mm:ss.FFFFFFF\Z",
                                                             @"yyyy-MM-dd\THH:mm:ss\Z",
                                                             @"yyyy-MM-dd\THH:mm:ssK",
                                                             @"yyyy-MM-dd\THH:mm:ss.FFFFFFF"
                                                         };
prabirshrestha commented 11 years ago

Would you mind sending a PR with unit tests. Note: We will only merge the formats that confirms with ISO8601 format.

Esam-Bustaty commented 10 years ago

I think we also need the format yyyy-MM-dd which is allowed in ISO8601 as calendar date (date only).

prabirshrestha commented 10 years ago

@Esam-Bustaty feel free to send a PR with tests.