The dayOfWeek Function will return an integer number that represents the day of the week for a date, where 0 is Sunday, 1 is Monday ending in 6, a Saturday.
It follows a simple pattern.
dayOfWeek('2019-10-28T10:10:00Z') will return 1 So we know it's a Monday
Please be aware that the reference material, Microsoft names objects like ‘2019-10-28T10:10:00Z’ as timestamps. I prefer calling them “Date” to avoid confusion with the UNIX timestamp, commonly used in APIs, to represent the number of seconds elapsed since Jan 01 1970 (UTC).
Since it returns an integer, you need to provide the translation to something that the end-user will understand. It can be tricky for apps in multiple languages but always translate the value. The user doesn’t know that 0 means Sunday.
Contrary to SharePoint and PowerApps, there’s no limitation to the date that you can use. You can do things like:
dayOfWeek('1000-12-30T00:00:00Z') and you'll get 2 So we know it's a Tuesday
- In some cultures the first day of the week is Monday and not Sunday, so one would expect 0 to be Monday. Don’t do any math in trying to convert to your preferred system. Just translate the value provided, and you’re good to go.
- To get the best results, please be sure that you’re passing a date that is UTC. If you’re storing somewhere your local time, use the “Convert Time Zone” action to convert it before providing the value to the dayOfWeek Function. If you don’t do it, you may be returning invalid values to the end-user.
Back to the Flow Function Reference.