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

1
Q

What function allows you to change the format of a date and how is this typically written?

A

formatDate (date; format; [timezone])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the main difference between parseDate and formatDate functions?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is the function parseDate written out?

A

parseDate (text; format; [timezone])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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?

A

addDays (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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?

A

addHours (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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?

A

addMinutes (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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?

A

addMonths (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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?

A

addSeconds (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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?

A

addYears (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What function returns a new date with the seconds specified in parameters? Usually a number from 0 to 59 is used.

A

setSecond (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What function returns a new date with the minutes specified in parameters? Usually a number from 0 to 59 is used.

A

setMinute (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What function returns a new date with the hours specified in parameters? Usually a number from 0 to 23 is used.

A

setHour (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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.

A

setDay (date; number/name of the day in English)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What function returns a new date with the day of the month specified in parameters? Usually a number from 1 to 31 is used.

A

setDate (date; number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What function returns a new date with the month specified in parameters? Usually a number from 1 to 12 is used.

A

setMonth (date; number/name of the month in English)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What function returns a new date with the year specified in parameters?

A

setYear (date; number)

17
Q

What function returns a number representing the difference in the two dates, expressed in the specified unit?

A

dateDifference (Date1; Date2; Unit)

*Date2 is subtracted from Date1.

18
Q

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?

A

{{addDays(setDate(1.date; 1); 1.n * 7 -formatDate(addDays(setDate(1.date; 1); “-“ + 1.dow); “E”))}}

19
Q

What expression can be used to calculate days between dates?

A

{{round((2.value - 1.value) / 1000 / 60 / 60 / 24)}}

20
Q

What expression can be used to calculate the last day of the month?

A

{{addDays(setDate(now; 1); -1)}}

21
Q

What expression can be used to calculate the last millisecond of the previous month?

A

{{parseDate(parseDate(formatDate(now; “YYYYMM01”); “YYYYMMDD”; “UTC”) - 1; “x”)}}