Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Problem with date time in Adobe Campaign web application

sagil23995776
Level 3
Level 3

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

1 Accepted Solution
sagil23995776
Correct answer by
Level 3
Level 3

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

View solution in original post

0 Replies
Amit_Kumar
Community Advisor
Community Advisor

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

sagil23995776
Level 3
Level 3

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

user1.JPG

webapp3.JPG

Sagi

Jean-Serge_Biro
Community Advisor
Community Advisor

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

sagil23995776
Correct answer by
Level 3
Level 3

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

View solution in original post

florentlb
Level 10
Level 10

Hi Sagi,

Were you able to resolve your issue?

Florent

sagil23995776
Level 3
Level 3

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