๐งญ Overview of Date and Time Functions in Power Automate
Power Automate provides many built-in Date and Time expressions using PowerFx-style functions (based on Azure Logic Apps workflow definition language).
All DateTime expressions begin with formatDateTime(), addDays(), utcNow(), etc., and are used in dynamic content or expressions inside flows.
๐ Commonly Used Date and Time Functions
1. utcNow()
Returns the current date and time in UTC.
- Syntax: utcNow()
- Example Output: 2025-07-22T08:12:34Z
โ Use this when you need the current time in flows.
2. addDays()
Adds a number of days to a specified date.
- Syntax: addDays(startDate, numberOfDays, format?)
- Example:
addDays(utcNow(), 5, ‘yyyy-MM-dd’)
Output: 2025-07-27
3. addHours()
Adds hours to a given date.
- Syntax: addHours(startDate, numberOfHours, format?)
- Example:
addHours(utcNow(), 3)
Output: 2025-07-22T11:12:34Z
4. addMinutes()
Adds minutes to a given date.
- Syntax: addMinutes(startDate, numberOfMinutes)
- Example:
addMinutes(utcNow(), 15)
5. subtractDays(), subtractHours(), subtractMinutes()
Subtract time from a date.
- Example:
subtractDays(utcNow(), 7, ‘yyyy-MM-dd’)
6. formatDateTime()
Formats a given date/time into a string format.
- Syntax: formatDateTime(date, format)
- Examples:
formatDateTime(utcNow(), ‘yyyy-MM-dd’)
formatDateTime(utcNow(), ‘dd/MM/yyyy hh:mm tt’)
formatDateTime(utcNow(), ‘dddd, MMMM dd yyyy’)
Outputs:
- 2025-07-22
- 22/07/2025 02:12 PM
- Tuesday, July 22 2025
7. convertTimeZone()
Converts a time from one time zone to another.
- Syntax: convertTimeZone(timestamp, sourceTimeZone, destinationTimeZone, format)
- Example:
convertTimeZone(utcNow(), ‘UTC’, ‘India Standard Time’, ‘yyyy-MM-dd hh:mm tt’)
Output: 2025-07-22 01:42 PM
8. day(), month(), year()
Extracts components of a date.
- Examples:
day(utcNow()) โ 22
month(utcNow()) โ 7
year(utcNow()) โ 2025
9. dayOfWeek()
Returns the day of the week (0 for Sunday, 6 for Saturday).
- Syntax: dayOfWeek(date)
- Example:
dayOfWeek(utcNow()) โ 2 (Tuesday)
10. ticks()
Returns a long number representing date and time (used for unique ID generation).
- Syntax: ticks(utcNow())
11. addToTime()
Adds time duration to a date.
- Syntax: addToTime(date, interval, timeUnit)
- Example:
addToTime(utcNow(), 30, ‘Minute’)
12. startOfDay(), startOfMonth()
Returns beginning of a day or month.
- Examples:
startOfDay(utcNow())
startOfMonth(utcNow())
13. endOfDay(), endOfMonth()
Returns end of a day or month.
- Examples:
endOfDay(utcNow())
endOfMonth(utcNow())
14. parseDateTime()
Parses a string into a datetime object.
- Syntax: parseDateTime(’22/07/2025′, ‘dd/MM/yyyy’)
๐ Real-life Examples
๐ Get current date in local time zone
convertTimeZone(utcNow(), ‘UTC’, ‘India Standard Time’, ‘yyyy-MM-dd’)
๐ Add 10 business days to a date (excluding weekends) โ Use loop
Loop through days and skip weekends using dayOfWeek() logic.
๐ Format due date 7 days from now
formatDateTime(addDays(utcNow(), 7), ‘dd-MM-yyyy’)
๐ Create a timestamp for unique filename
concat(‘Invoice_’, formatDateTime(utcNow(), ‘yyyyMMdd_HHmmss’), ‘.pdf’)
๐ Calculate age from Date of Birth
div(sub(ticks(utcNow()), ticks(triggerOutputs()?[‘body/DOB’])), 3155695200000000)
๐ Formatting Reference (Standard Patterns)
| Format Token | Description | Example |
| yyyy | Year | 2025 |
| MM | Month (01โ12) | 07 |
| dd | Day (01โ31) | 22 |
| HH | Hour (00โ23) | 14 |
| hh | Hour (01โ12) | 02 |
| mm | Minute (00โ59) | 43 |
| tt | AM/PM | PM |
| dddd | Day name | Tuesday |
โ Best Practices
- Always use convertTimeZone() to adjust to local time zones.
- For business processes, use startOfDay() and endOfDay() to reduce ambiguity.
- Format dates before saving to Excel or SharePoint.
- When comparing dates, always convert both to the same format and time zone.

Leave a comment