Problem with date time in Adobe Campaign web application

Avatar

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
sagil23995776
Level 2

07-08-2017

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)

webapp1.JPG

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'

webapp2.JPG

Does anyone know how can it be fixes?

Thanks,

Sagi

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
sagil23995776
Level 2

17-08-2017

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

Answers (5)

Answers (5)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

08-08-2017

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:

  • debug context
  • how you get the calendar variable value (formatDate, etc), Javascript code of variable setting/getting the value
  • check that the variable is defined as date+time
  • the JS code to display in the webApp compatibility v5 the calendar object value set with your variable

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) :

1274627_pastedImage_5.png

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.

1274628_pastedImage_7.png
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

Avatar

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
sagil23995776
Level 2

27-08-2017

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

Avatar

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile
florentlb
Level 10

25-08-2017

Hi Sagi,

Were you able to resolve your issue?

Florent

Avatar

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
sagil23995776
Level 2

Likes

17 likes

Total Posts

32 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
sagil23995776
Level 2

08-08-2017

Hi Amit,
Both the user and the web app are configured to use the server time zone:

user1.JPG

webapp3.JPG

Sagi

Avatar

Avatar
Springboard
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct reply

231 solutions
Top badges earned
Springboard
Ignite 5
Ignite 3
Ignite 1
Validate 10
View profile

Avatar
Springboard
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct reply

231 solutions
Top badges earned
Springboard
Ignite 5
Ignite 3
Ignite 1
Validate 10
View profile
Amit_Kumar
MVP

08-08-2017

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