We have an app hosted on a server in the UK that is accessed by customers all over the world. Our customers open an order for their company which is added to over time. One of the things they need to do whilst setting up their order is to select an order closing date at which point the order is closed automatically and submitted.
We want to close any order at midnight (local time based on timezone) on the date that is selected by the customer but this poses a problem when we take different timezones into consideration as our server is in the UK. Our server needs to know at which UK time to close the order so that the customer sees their order close at midnight their time.
We are asking customers to enter their timezone as part of the setup of their account so we are storing that in the database as a .net timezoneinfo id. We will also store the targetCloseDate which is say 30 Sep 2012 (in order to display the to user). However we need to convert the target date to a UK time that our server uses as the order close date.
How do we do this conversion?
Cheers
Wing
Have answered this myself after looking more into the timezoneinfo class. You can use:
This converts a datetime value – orderCloseDate using a source timezone and a destination timezone… perfect!!!
Wing