How to change time zone
Application Type
Traditional Web, Mobile, Reactive, Service

i am using CurrDateTime() currently to show date and time and it is bydefault giving time in GMT +0 but now Iwant that time in GMT +1 it means that I want time of after 1 hour to show. Please suggest some solutions.

Solution

Hello Manjeet,

As outsystems does not allow to change the time zone.

You have to handle it programmatically.

You can use time related functions like:- Addhours to achieve your goal.


Thanks,

Krunal

Can you please provide me  a guide for this Addhours  function. Any link?

Thanks Krunal, But I have one little issue.  I am using below function to increase time by 1 hour as you suggest :

AddHours(CurrDateTime(), 1)

But I am getting error as " 'Default value' must be set to 'Date Time' literal value". Currently I am using CurrDateTime() function to show date and time and it is 1 hour less than what I desire. Please help.

Solution

Hello Manjeet,

Are you directly assigning this expression to UI?

I am not sure weather it will work.

Just assign this expression to a local variable and then use that local variable for your further operations.

If you can share your OML that will be great.


Thanks,

Krunal

Hello krunal, I tried to put  the expression in local variable but again getting the same error. please have a look below :


Below is the expression in a local variable :


Below is the eroor I am getting :

Solution

Hello Manjeet,

You cannot do such assignment on default value.

You have to do it via a client action

Try to assign a local variable of type date time in oninitialize function of screen.

Solution

Hello Manjeet,

Are you directly assigning this expression to UI?

I am not sure weather it will work.

Just assign this expression to a local variable and then use that local variable for your further operations.

If you can share your OML that will be great.


Thanks,

Krunal

Solution

Hello Manjeet,

You cannot do such assignment on default value.

You have to do it via a client action

Try to assign a local variable of type date time in oninitialize function of screen.

Hello @Manjeet Mishra,

Please review this link. 

The time-zone forge component recommended in the above article works quite well if you need to display the non UTC timezone value in multiple datetime fields in your application.

Regards

AJ

Solution

Hello Manjeet,

As outsystems does not allow to change the time zone.

You have to handle it programmatically.

You can use time related functions like:- Addhours to achieve your goal.


Thanks,

Krunal

Can you please provide me  a guide for this Addhours  function. Any link?

Thanks Krunal, But I have one little issue.  I am using below function to increase time by 1 hour as you suggest :

AddHours(CurrDateTime(), 1)

But I am getting error as " 'Default value' must be set to 'Date Time' literal value". Currently I am using CurrDateTime() function to show date and time and it is 1 hour less than what I desire. Please help.

Solution

Hello Manjeet,

Are you directly assigning this expression to UI?

I am not sure weather it will work.

Just assign this expression to a local variable and then use that local variable for your further operations.

If you can share your OML that will be great.


Thanks,

Krunal

Hello krunal, I tried to put  the expression in local variable but again getting the same error. please have a look below :


Below is the expression in a local variable :


Below is the eroor I am getting :

Solution

Hello Manjeet,

You cannot do such assignment on default value.

You have to do it via a client action

Try to assign a local variable of type date time in oninitialize function of screen.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.