Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How we can resolve the datetime problem shifting the Access DB from production server to live

Tags:

c#

ms-access

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

like image 963
Kthevar Avatar asked Dec 06 '25 06:12

Kthevar


2 Answers

As a general rule, converting DateTime to/from string without specifying exact format is almost every time a bad idea.

like image 84
Dmitry Ornatsky Avatar answered Dec 09 '25 10:12

Dmitry Ornatsky


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.

like image 37
BIBD Avatar answered Dec 09 '25 08:12

BIBD



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!