Salesforce-Marketing-Cloud-Engagement-Developer Practice Test

Salesforce Spring 25 Release
196 Questions

A developer wants to transform the date and time 'Data_Enrolled' from Daylight Savings time. How would the developer change the time to fall back one hour?

A. %%=DataAdd(Date_Enrolled,-1)=%%

B. %%=DateAdd(Date_Enrolled,-1 'H')=%%

C. %%=DateDiff(Date_Enrolled, 1,'H')=%%

D. %%=FormatDate(Date_Enrolled,-1,'HH','en-us')=%%

B.   %%=DateAdd(Date_Enrolled,-1 'H')=%%

Explanation:

✅ B. DateAdd(Date_Enrolled,-1, 'H')
The DateAdd function adds (or subtracts) a specific unit of time to a date. To subtract 1 hour, you specify -1 as the value and 'H' (hour) as the unit. This is the correct and standard way to adjust for daylight saving fallback.

❌ A. DataAdd(Date_Enrolled,-1)
This syntax is incomplete—it doesn’t specify the unit (like 'H' for hours). AMPscript will fail or default unexpectedly.

❌ C. DateDiff(Date_Enrolled, 1,'H')
DateDiff calculates the difference between two dates. It’s not used for transforming or adjusting date values.

❌ D. FormatDate(...)
FormatDate is used for displaying a date in a specific format. It does not adjust the actual date/time value.

Salesforce-Marketing-Cloud-Engagement-Developer Practice-Test - Home Previous
Page 3 out of 196 Pages