We, as shipping company, have users which have to log their vessel activities. Our vessels cross the sea and travel all over the world, meaning they travel through different timezones. All our datetime fields are being logged in UTC time, however it would be easier for our users to log in Local Time based on the selected port.
Lets say, the Captain of the Vessel wants to log their Departure in port “Taicang”. Now the Captain needs to calculate the time in UTC before being able to log their activity. It would be much easier for them to log in Local Time, so that we calculate the UTC time for them. We also have “Planners” who would like to communicate with Local Time towards the Captains.
In short, we would like to make use of Local Time in a lot of places within our application. While doing research I found the following methods to calculate from/and to Local Time.
-
Use of a query like follows:
-
SELECT @UtcTime AT TIME ZONE 'China Standard Time' AS TaicangTime
-
Downside: In some ports, the timezone changes at some point to daylight time. I am not completely sure if we can manage this correctly.
-
-
- Use of sys.time_zone_info
- Downside: Timezone data is apparently retrieved from files on the computer. Which I am not sure if it is reliable.
What do you suggest? Or is there already functionality made by Thinkwise to retrieve Local Time?