Date and Time Functions in Fusion Flashcards
https://experienceleague.adobe.com/en/docs/workfront/using/adobe-workfront-fusion/functions-in-fusion/date-and-time-functions
What function allows you to change the format of a date and how is this typically written?
formatDate (date; format; [timezone])
What is the main difference between parseDate and formatDate functions?
parseDate is used to turn a text value into a date value.
formatDate just changes the formate of a date value to another date value format.
How is the function parseDate written out?
parseDate (text; format; [timezone])
What function returns a new date as a result of adding a given number of days to a date, or can be used to subtract days by entering a negative number?
addDays (date; number)
What function returns a new date as a result of adding a given number of hours to a date, or can be used to subtract hours by entering a negative number?
addHours (date; number)
What function returns a new date as a result of adding a given number of minutes to a date, or can be used to subtract hours by entering a negative number?
addMinutes (date; number)
What function returns a new date as a result of adding a given number of months to a date, or can be used to subtract hours by entering a negative number?
addMonths (date; number)
What function returns a new date as a result of adding a given number of seconds to a date, or can be used to subtract hours by entering a negative number?
addSeconds (date; number)
What function returns a new date as a result of adding a given number of years to a date, or can be used to subtract hours by entering a negative number?
addYears (date; number)
What function returns a new date with the seconds specified in parameters? Usually a number from 0 to 59 is used.
setSecond (date; number)
What function returns a new date with the minutes specified in parameters? Usually a number from 0 to 59 is used.
setMinute (date; number)
What function returns a new date with the hours specified in parameters? Usually a number from 0 to 23 is used.
setHour (date; number)
What function returns a new date with the hours specified in parameters? Usually, Sunday set as 1 and Saturday set as a 7 in this function.
setDay (date; number/name of the day in English)
What function returns a new date with the day of the month specified in parameters? Usually a number from 1 to 31 is used.
setDate (date; number)
What function returns a new date with the month specified in parameters? Usually a number from 1 to 12 is used.
setMonth (date; number/name of the month in English)
What function returns a new date with the year specified in parameters?
setYear (date; number)
What function returns a number representing the difference in the two dates, expressed in the specified unit?
dateDifference (Date1; Date2; Unit)
*Date2 is subtracted from Date1.
If you need to calculate a date corresponding to n-th day of week in month (for example, first Tuesday, third Friday, and so on), what is the formula that can be used?
{{addDays(setDate(1.date; 1); 1.n * 7 -formatDate(addDays(setDate(1.date; 1); “-“ + 1.dow); “E”))}}
What expression can be used to calculate days between dates?
{{round((2.value - 1.value) / 1000 / 60 / 60 / 24)}}
What expression can be used to calculate the last day of the month?
{{addDays(setDate(now; 1); -1)}}
What expression can be used to calculate the last millisecond of the previous month?
{{parseDate(parseDate(formatDate(now; “YYYYMM01”); “YYYYMMDD”; “UTC”) - 1; “x”)}}