0

I have been facing the issue in IIS after publishing seems there was a issue in date format.(dd/mm/yyyy)

Local before publishing

http://localhost:50509/Api/booking?bookingDate=01/11/2016&facBookID=0&isFacBook=Y

It returns NOV 1st record.but after publishing this one returns JAN 11th records.

Any help would be really appreciated.

Jays
  • 90
  • 8
  • probably has to do with culture settings on machine. use yyyy-MM-dd to avoid confusion – Nkosi Nov 04 '16 at 17:07
  • we are calling the api through mobile using this format (dd/mm/yyyy) we could not able to get it right..can you please tell me the solution @Nkosi – Jays Nov 04 '16 at 17:09
  • Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the [How to Ask](http://stackoverflow.com/help/how-to-ask) page for help clarifying this question. – Nkosi Nov 04 '16 at 17:11
  • Are you able to change format? – Nkosi Nov 04 '16 at 17:13
  • This dd/mm/yyyy date format which i used to call from mobile app..so i have decided to use same format as well.@Nkosi – Jays Nov 04 '16 at 17:13
  • Using that format will cause the problems you are getting. reformat the date to use yyyy/MM/dd. – Nkosi Nov 04 '16 at 17:14
  • 1
    Probably because the culture of your iis is different than the one on your local machine. You can force your culture to the one you want on your global.asax file – Stormhashe Nov 04 '16 at 17:14
  • unfortunately i have published on same machine @Stormhashe – Jays Nov 04 '16 at 17:16
  • Even so, your iis culture might be different than your culture on asp net's development environment. try forcing it on global.asax, it should work – Stormhashe Nov 04 '16 at 17:18
  • I have already added this on global.asax **CultureInfo newCulture = (CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone(); newCulture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy"; newCulture.DateTimeFormat.DateSeparator = "/"; System.Threading.Thread.CurrentThread.CurrentCulture = newCulture;** @Stormhashe – Jays Nov 04 '16 at 17:20
  • Try this solution : http://stackoverflow.com/questions/11237765/datetime-format-issue-in-iis-7-server and just change the server settings without any code change. – Jose Francis Nov 08 '16 at 12:53

0 Answers0