I've created a web application where I have a variable containing date and time.
If I print the variable in an HTML element I see the date and time as required,
but if I'm calling the variable from a date input field then I see a different time (see below)
In the HTML element in the page the time is 17:00 but its 22:00 in the input field.
both are using the same variable - 'varSendStart'
Does anyone know how can it be fixes?
I've tried changing my computer time zone to the time zone of the server and the times looked good then.
Anyhow since we have users in multiple time zones I tried to avoid all this time zone managing. I used the field as a text instead of a date and it seems to worked fine from all locations (just needed to apply some validation rules on the input to check if its a real date)/
So, please may you give more information:
I tried to reproduce it but it works fine for me, either with 3 PM time format or my preferred time format for France 15:00. (and even with variable defined with text format...), with that method:
ctx.vars.var2 = getCurrentDate()
2. the value doesn't appear without specific code in the calendar type field (blank); but after selecting the value of date of current day, hour is correctly set to current time (local time) :
Please do some logInfo in order to check that the calendar date object is correctly registered with the standardized datetime value (the format stored internally in the DB) after the webApp.
Before, if you set if with getCurrentDate, the date is displayed in another format except if you do some formatDate, depending on your need), as kind of:
ctx.vars.datetime_jour = formatDate(getCurrentDate(),"%4Y-%2M-%2D %02H:%02N:%02S")
Many thanks in advance for your complementary information.
Yes just as I've mentioned above, I used it as text and not as a date placed a JS validation rules for the input and that worked.
Were you able to resolve your issue?
Both the user and the web app are configured to use the server time zone:
It looks like a time zone issue to me. Can you ensure that you are using same time zone for a web app and your user profile?