Steps:
1- Add Date and Time Component
Date And Time:nowday
2- Print nowday.datetime and nowday.datetime.addHours(3)
OUTPUT 1: 2020-12-18T21:45:16Z
OUTPUT 2: 2020-12-19 03:45:16
I add 3 hours it adds 6 hours
Steps:
1- Add Date and Time Component
Date And Time:nowday
2- Print nowday.datetime and nowday.datetime.addHours(3)
OUTPUT 1: 2020-12-18T21:45:16Z
OUTPUT 2: 2020-12-19 03:45:16
I add 3 hours it adds 6 hours
Can you please post the code you have for these on the page exactly?
So you have enabled UTC time as well?
What’s your server model?
I think error is addHours adds to localtime not the datetime is given. My time zone is UTC +3
server model is
IIS PHP
You’ve set your datettime variable to UTC time, that’s why you see the UTC time when usin:
nowday.datetime
When using date formatters on the clientside they always use local time so use toUTCDate()
formatter to get utc date again for the formatted value:
nowday.datetime.addHours(3).toUTCDate()