Add Hours doesn't add the hours into the DateTime

Hi,


I have an issue where AddHours does not add hours into the CurrDateTime (I add hours to align with my own timezone). I assign it to a session variable.

Hi Yao,

Its working fine for my case you can check in attached OML.

Lovely Priyadarshini wrote:

Hi Yao,

Its working fine for my case you can check in attached OML.

Well that didn't work


Hi,

Sorry I attached wrong OML. Check new one

Hello Yao, 

1. Are you adding the hours before or after saving it to database? 

2. Are you taking into account timezones, and that this can cause the date saved in database, as the CurrDateTime() returns the server time, not to be the same as the one on your timezone? 

Cheers

Eduardo Jauch wrote:

Hello Yao, 

1. Are you adding the hours before or after saving it to database? 

2. Are you taking into account timezones, and that this can cause the date saved in database, as the CurrDateTime() returns the server time, not to be the same as the one on your timezone? 

Cheers

1. Before

2. No, I just want to add 8 hours to make it simple


Can you show the logic, with the assignments before saving to database and the create configuration? 

Because the only reason I see to the AddHours to not work is you are not using its result. 

Another possibilitybis to execute in debug, and see how things are changing. 

Eduardo Jauch wrote:

Can you show the logic, with the assignments before saving to database and the create configuration? 

Because the only reason I see to the AddHours to not work is you are not using its result. 

Another possibilitybis to execute in debug, and see how things are changing.