Question

I deployed the application on normal windows 7 machine as it is central machine for official use. this is internal use application. bu the datetime manipulation on the deployed machine not working properly. since everything if working properly on development machine. I thought it might be the Regional settings issue but as i settled up same settings on deployment machine same like development machine, still issue is same. issue is deployment machine unable to understand the which is MM and dd. suppose i am sending date like "11-jul-2013" then somehow it converting it to "11-07-2013" this is ok. but date 13 will not work for this case.

Edited: I added

   globalization:
   fileEncoding="utf-8"
   requestEncoding="utf-8"
   responseEncoding="utf-8"
   culture="en-US"
   uiCulture="en-US"

in the web.config. but still problem is same. what should be the issue? really I am stuck.

Était-ce utile?

La solution

Sounds like it could be an issue with your culture settings. Try debugging by checking what culture is currently set (CultureInfo.CurrentCulture) right before you are using the date.

Autres conseils

Parsing is inherently a difficult operation for dates. From your question, it seems like you are parsing dates from some type of backend (database, server, file, etc). In the case of backend date parsing/formatting, you should always use standard formats. This means using TryParseExact/ToString with a pattern such as RFC1123Pattern and invariant culture. In the case of parsing dates from a frontend (direct user input), the current culture settings should work fine.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top