can you do a zulu time offset per tenant?

can you do a zulu time offset based on tenant?

Hi Jason,

Is zulu time offset not UTC+0 ?

OutSystems cloud offerings do use UTC time on server, if you are have Outsystems on Premise then you can set the timezone of your server to your own need I suppose.

What do you mean time offset based on tenant? when you only refer to one time zone.

You could create a TenantExtended entity with 1-to-1 relation to Tenant and store a local TimeZone.

Than you can use that to display the utc in local time based on tenant of user.

Some reading material on time zone:

The following component can be used for conversion between local time and utc or other time zones:

https://www.outsystems.com/forge/component-overview/500/time-zone


Regards,

Daniel


Hi Jason,

You may continue storing all time in standard UTC time zone. In Multi Tenancy environment store the UtcOffset value in tenant settings in combination with Daylight Saving property. On the frontend actions you would like to use ConvertFromUTC and ConvertToUTC to give user a localized touch.


Regards,

Swatantra

Daniël Kuhlmann wrote:

Hi Jason,

Is zulu time offset not UTC+0 ?

OutSystems cloud offerings do use UTC time on server, if you are have Outsystems on Premise then you can set the timezone of your server to your own need I suppose.

What do you mean time offset based on tenant? when you only refer to one time zone.

You could create a TenantExtended entity with 1-to-1 relation to Tenant and store a local TimeZone.

Than you can use that to display the utc in local time based on tenant of user.

Some reading material on time zone:

The following component can be used for conversion between local time and utc or other time zones:

https://www.outsystems.com/forge/component-overview/500/time-zone


Regards,

Daniel


Daniel - to elaborate on my initial post: we have a setup where we have 2 tenants.  The server is set up to use EST which is the "main" tenant.  However, we recently added another tenant who uses mountain time and I was asking if there was a setting at the tenant level so that it would just magically offset all time values for that specific tenant from EST.  It looks like the next response addresses that.


Swatantra Kumar wrote:

Hi Jason,

You may continue storing all time in standard UTC time zone. In Multi Tenancy environment store the UtcOffset value in tenant settings in combination with Daylight Saving property. On the frontend actions you would like to use ConvertFromUTC and ConvertToUTC to give user a localized touch.


Regards,

Swatantra

Swatantra, I think this is what I was looking for.  Will try this out and if it works mark your comment as resolution.  Thanks!


Hi Jason,

Swatantra, is correctly describing in a bit more detail what I outlined.

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Jason,

Swatantra, is correctly describing in a bit more detail what I outlined.

Regards,

Daniel

Daniel - you are correct - sorry for not seeing that.

So the issue here is that it looks like for what you and Swantantra are suggesting is that you set the server to a certain time zone and then use the utcoffset action wherever you are getting times out of the database.  The issue with us is that we have one tenant on the server and all the code was written such that it uses what is in the database.  I think what we were hoping for is something more along the lines of setting a time offset for a new tenant and then whenever someone opens one of our existing pages it would offset the server time by that time WITHOUT us having to go to all of our code locations where we use time and adding that action.  If so that would be at least a week or two of work to find all the locations and test.

Is there something like a meta setting on tenant where we can put the timezone of that tenant and then whenever that tenant is selected it offsets server time by that amount?


Solution

I would suggest to set the server always to UTC (this is what OutSystems does if you have an infrastructure in the cload). 

Even if you are onpremise i would advice to use UTC,

Why?

If in the unknown future your company decides to move the infrastructure to the cloud, then you do not have datetime conversion issues to UTC time.

You should not store the time per tenant in different time zone. All use UTC.

The tenant entity is a system entity that you can not change. But you can create a new Entity called TenantExtended and with the Id set to Tenant_Id. Then on the TenantExtended entity you can add all the attributes you need for a tenant.

Justin James, one of OutSystems MVP's has a good article on the subject of why you always want to create a TenantExtended entiy:

https://medium.com/@jmjames/outsystems-multitenancy-tenant-is-active-and-user-logins-11f796ab3f03

Regards,

Daniel

Solution

Daniel - I completely understand - just wish I had known that before we wrote all the code that uses straight server time.

Jason Herrington wrote:

Swatantra Kumar wrote:

Hi Jason,

You may continue storing all time in standard UTC time zone. In Multi Tenancy environment store the UtcOffset value in tenant settings in combination with Daylight Saving property. On the frontend actions you would like to use ConvertFromUTC and ConvertToUTC to give user a localized touch.


Regards,

Swatantra

Swatantra, I think this is what I was looking for.  Will try this out and if it works mark your comment as resolution.  Thanks!


Glad Jason. that it helped you to understand the timings in multi-tenancy environment. Happy to help :)


Daniël Kuhlmann wrote:

I would suggest to set the server always to UTC (this is what OutSystems does if you have an infrastructure in the cload). 

Even if you are onpremise i would advice to use UTC,

Why?

If in the unknown future your company decides to move the infrastructure to the cloud, then you do not have datetime conversion issues to UTC time.

You should not store the time per tenant in different time zone. All use UTC.

The tenant entity is a system entity that you can not change. But you can create a new Entity called TenantExtended and with the Id set to Tenant_Id. Then on the TenantExtended entity you can add all the attributes you need for a tenant.

Justin James, one of OutSystems MVP's has a good article on the subject of why you always want to create a TenantExtended entiy:

https://medium.com/@jmjames/outsystems-multitenancy-tenant-is-active-and-user-logins-11f796ab3f03

Regards,

Daniel

Daniel, That's very nice article. I've been practising the same logic without even knowing about Justin's article :)