Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Difference in "date field" between Target Data and HTML content

Avatar

Level 3

Hello all, I'm facing a weird issue as follows:

In the database and after querying a list I have a column that contains a specific date in a regular format

date 2.png

I'm manipulating the data with this JS code:

var lastDate = formatDate(targetData.LastFillDate,"%2M/%2D/%2Y");

So, after sending proofs I can see the date was modified showing one day less, like:

date 1.png

So, have you faced this issue, and do you know how to resolve it? Thank you.

Note: If I don't modify the data with JS, I get something like this (see the format):

Captura de Pantalla 2022-09-06 a la(s) 15.44.29.png

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

storing and presenting date(time) fields can be tricky. I had the exact same issue and it turned out the Campaign server was set up to use a different timezone than UTC. That means the date/time values are stored in UTC. 

They way they are presented can be completely different, eg. when your Campaign operator is set to use a different timezone (see operator details).

I recommend reading this page: https://experienceleague.adobe.com/docs/campaign-classic/using/installing-campaign-classic/install-c...

As mentioned by others I would also recommend using the timezone parameter on the formatDate function to force a specific timezone.

Best regards, Tobias

View solution in original post

4 Replies

Avatar

Level 7

Hi @israel_sanchez ,

Try adding RX1_LastFillDate in an enrichment activity and apply ToDate function

Anita_punmiya_0-1662513283341.png

and then use formatDate function in your HTML on that date field. 

Hope this helps.

 

Thanks.

 

 

Avatar

Level 3

Hello, thank you for the insight, it didn't work, we are searching for another option.

Avatar

Community Advisor

Hello @israel_sanchez 

 

Try adding a timezone parameter in the formatDate function or change the timezone in the workflow properties.

 

formatDate (adobe.com)


     Manoj
     Find me on LinkedIn

Avatar

Correct answer by
Employee Advisor

Hi,

storing and presenting date(time) fields can be tricky. I had the exact same issue and it turned out the Campaign server was set up to use a different timezone than UTC. That means the date/time values are stored in UTC. 

They way they are presented can be completely different, eg. when your Campaign operator is set to use a different timezone (see operator details).

I recommend reading this page: https://experienceleague.adobe.com/docs/campaign-classic/using/installing-campaign-classic/install-c...

As mentioned by others I would also recommend using the timezone parameter on the formatDate function to force a specific timezone.

Best regards, Tobias