- If The Current Date is 16-April-2021T12:17:10.1808189Z then
- Add month to a date (Use addToTime expression)
- addToTime(utcNow(),1,'month')
- If utcNow() is 16-April-2021T12:17:10.2433164Z then above expression will return 16-May-2021T12:17:10.2433164Z
- Jump to 1st day of next month (Use startOfMonth expression)
- startOfMonth(addToTime(utcNow(),1,'month'))
- If utcNow() is 21-April-2021T12:17:10.2433164Z then above expression will return 01-May-2021T00:00:00.0000000Z
- Jump to 1st day of current month (Use startOfMonth expression)
- startOfMonth(utcNow())
- If utcNow() is 21-April-2021T12:17:10.2433164Z then above expression will return 01-April-2021T00:00:00.0000000Z
- Get last date of current month (Use subtractFromTime expression)
- subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day')
- If utcNow() is 21-April-2021T12:17:10.2433164Z then above expression will return 30-April-2021T00:00:00.0000000Z
- Get last date of previous month (Use subtractFromTime expression)
- subtractFromTime(startOfMonth(utcNow()),1,'day')
- If utcNow() is 21-April-2021T12:17:10.2433164Z then above expression will return 31-March-2021T00:00:00.0000000Z
- Get start of today (Use startofDay expression)
- startOfDay(utcNow())
- If utcNow() is 16-April-2021T18:05:03.1234567Z then above expression will return 16-April-2021T00:00:00.000000Z
- Date:- 17-Apr-2021
- Get Current Year (Use formatDateTime expression)
- formatDateTime(utcNow(),'yyyy')
- Get Current Month (Full Name) (Use formatDateTime expression)
- formatDateTime(utcNow(),'MMMM')
- Get Current Month (Abbreviation) (Use formatDateTime expression)
- formatDateTime(utcNow(),'MMM')
- Get Current Month (Number) (Use formatDateTime expression)
- formatDateTime(utcNow(),'MM')
- Get Current Day Of Month (Use formatDateTime expression)
- formatDateTime(utcNow(),'dd')
- Get Current Day Of Year (Use dayOfYear expression)
- dayOfYear(utcNow())
- It returns the day of year starting from 1 Jan
- Get Day Of Month (Use dayOfMonth expression)
- dayOfMonth(utcNow())
- Get Day Of Week (Use dayOfWeek expression)
- dayOfWeek(utcNow())
- It takes Sunday as 0, Monday as 1, Tuesday as 2, Wednesday as 3, Thursday as 4, Friday as 5, Saturday as 6
- Get Day Of Week (Name) (Use formatDateTime expression)
- formatDateTime(utcNow(),'dddd')
- Get First Day Of Week (Complete Date) (Use subtractFromTime with dayOfWeek expression)
- subtractFromTime(utcNow(), dayOfWeek(utcNow()), 'Day')
- Get First Day Of Week (Name Of Day) (Use formatDateTime with subtractFromTime with dayOfWeek expression)
- formatDateTime(subtractFromTime(utcNow(), dayOfWeek(utcNow()), 'Day'), 'dddd')
- If you want Monday as 1st day of week, the modify the above expression as any of the below-
- formatDateTime(subtractFromTime(addDays(utcNow(), 1), dayOfWeek(utcNow()), 'Day'), 'dddd')
- formatDateTime(subtractFromTime(utcNow(), sub(dayOfWeek(utcNow()), 1), 'Day'), 'dddd')
- Will add more soon...
Friday, April 16, 2021
Power Automate: Play With Dates
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.