Timezone for .NET + SQL Server

Referring to https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/OutSystems_Cloud_and_time_zones

Developer needs to use "Time Zone" from the forge to help if the website is using .NET + SQL Server.

However, unsure if it was my misunderstanding, the plugin does not allow us to set the default timezone of the system. If what I said here was correct, does that mean we have to add a function, which can be something like ConvertFromTimeZone, in every single line of codes that we set a Datetime / Date?

If what I said was wrong and the plugin allows to set a default timezone, how can we do it?

Solution

Hi Stephen,

No, that plugin does not allow you to change the system's timezone. As the article you linked to states, if you're using .NET + SQL Server in the cloud, the system's timezone is always going to be UTC and there's no way of changing that.

So yes, you're always going to have to convert Datetimes from UTC to the desired time zone whenever you want to display them in your application. Don't forget to also convert Datetimes provided by the users to UTC before saving them to the database.

Solution

Aurelio Junior wrote:

Hi Stephen,

No, that plugin does not allow you to change the system's timezone. As the article you linked to states, if you're using .NET + SQL Server in the cloud, the system's timezone is always going to be UTC and there's no way of changing that.

So yes, you're always going to have to convert Datetimes from UTC to the desired time zone whenever you want to display them in your application. Don't forget to also convert Datetimes provided by the users to UTC before saving them to the database.

That's very unfortunate to hear that... I am surprised that Outsystems couldn't do this simple task despite the fact that it convenience us in other parts of development.