Power Automate: formatDateTime Function
Converts a date into any format using specifiers or custom patterns like 'ddd MM yyyy'.
Power Automate expressions are where a lot of the real magic happens, and this is my reference for the functions that power them. When the point-and-click designer runs out of road, a well-placed expression gets you exactly what you need. I document the everyday date and time helpers like the "addDays" function, the "addHours" function, and the "addMinutes" function, along with the more flexible "addToTime" function for shifting timestamps. I cover math with the "add" function, logic with the "and" function, and data shaping with the "addProperty" function and the "array" function. Need to convert data types? The "base64ToBinary" function gets its own walkthrough, and the "action" and "actions" functions let you reach into earlier steps. Every entry gives you the syntax, the parameters, the return value, a practical example, and the edge cases that catch people out.
Converts a date into any format using specifiers or custom patterns like 'ddd MM yyyy'.
Adds or removes seconds from a date with a custom format.
Adds or removes minutes from a date with a custom format. No date range limits.
Adds or subtracts days from a date. The day count must be an integer, not a decimal.
Adds or removes hours from a date with a custom format.
Returns an integer for the day of the week from a date. Sunday is 0, Saturday is 6.
Returns the current UTC date and time.