Hi,
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?
Thanks,
Sagi
Solved! Go to Solution.
Views
Replies
Total Likes
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)/
Thanks you
Sagi
Views
Replies
Total Likes
Hi Sagi,
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?
Regards,
Amit
Views
Replies
Total Likes
Hi Amit,
Both the user and the web app are configured to use the server time zone:
Sagi
Views
Replies
Total Likes
Hello Sagi,
I agree with Amit, it is clearly a timezone management subject, but probably not an issue, to my mind, but more method involved to manage in your code. Frankly said, timezone management is always difficult, either in SQL or in Javascript...
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:
1. javascript activity to set the variable value:
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.
Best Regards
J-Serge
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)/
Thanks you
Sagi
Views
Replies
Total Likes
Hi Sagi,
Were you able to resolve your issue?
Florent
Views
Replies
Total Likes
Hi,
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.
Thanks,
Sagi
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies