Can you advice best way to rectify timezone issues in .Net. Recently I developed a simlple website by using asp.net C# as codebehind adn MS Access as backend.
My production server and live servers are in different date time setting. My producttion server date format is dd-mm-yyyy
live server format is mm-dd-yyyy.
I am facing an error when i tried to cast the datetime in front end. "String was not recognized as a valid DateTime."
The date i try to cast was populated in my production server it works fine in production server. but when i push the access file into live server I am facing the above error. any help would much appreciated
As a general rule, converting DateTime to/from string without specifying exact format is almost every time a bad idea.
Convert the date to an ISO Date format instead - YYYY-MM-DD. When you put it in that format, there is ZERO ambiguity, and MS's date functions always understands it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With