I recently switched my hosting provider and due to the time zone that the server is now in, my code has stopped working.
The hosting server reports in Pacific time, However, my code needs to work with GMT as my site is for the UK market. So, all my displays and searches need to be in the format dd/MM/yyyy
How can I account for the difference?
For instance, when I do a DateTime.Parse("03/11/2008") it fail as I assume the 'Parse' is against the servers settings. I also get "String was not recognized as a valid DateTime." throughout my code.
In your web.config file add <globalization>
element under <system.web>
node:
<system.web>
<globalization culture="en-gb"/>
<!-- ... -->
</system.web>
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