{"id":110916,"date":"2017-11-28T07:57:22","date_gmt":"2017-11-28T15:57:22","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/"},"modified":"2017-11-28T07:57:22","modified_gmt":"2017-11-28T15:57:22","slug":"working-with-dates-and-times","status":"publish","type":"power-automate","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/","title":{"rendered":"Working with Dates and Times inside of your flows"},"content":{"rendered":"

Last month we announced new actions and expressions to help you work with dates and times<\/a>. Read more today, to learn about how to use these features.<\/p>\n

Send an email with formatted times<\/h2>\n

One common scenario is to send an email about files created in a OneDrive or SharePoint list. You want the created time text in the email to be in the right time zone for your company. However, all times in Microsoft Flow are in Universal Time (aka, UTC or GMT) by default.\u00a0To get started, let’s create a Flow from blank<\/a> with the\u00a0When a file is created or modified (properties only)<\/strong>\u00a0trigger:<\/p>\n

\"\"<\/p>\n

Now, select New Step<\/strong> and Add an Action<\/strong>. You will be given a lot of options – we support over 300 different actions today. To find the actions that work with dates and times, search for\u00a0Date Time<\/strong>\u00a0and select that connector. You will see the six actions that we have today:<\/p>\n

\"\"<\/p>\n

In this scenario, let’s select\u00a0Convert time zone<\/strong>. In the\u00a0Base time\u00a0<\/strong>property select\u00a0Created<\/strong>\u00a0from the\u00a0Add dynamic content\u00a0<\/strong>menu – this will contain the time the file was created in SharePoint, in UTC. Note that all <\/em>times output by any action are in UTC.<\/p>\n

\"\"<\/p>\n

Thus, for Source time zone<\/b>\u00a0select UTC. For\u00a0Destination time zone\u00a0<\/strong>select the time zone that your organization uses. Finally, you can choose a friendly format string to include in your email. I like the\u00a0General date\/time<\/em>, which looks like: 6\/15\/2009 1:45PM.<\/p>\n

Second, you’ll want to repeat this same process for the\u00a0Modified<\/strong> time of the file (add another Convert time zone<\/strong>\u00a0action, but this time select Modified\u00a0<\/strong>from the Dynamic content<\/b>).<\/p>\n

Finally, add an\u00a0Send an email<\/strong>\u00a0action. First, fill out who you want the email to go to, and the subject of the email. Then in the Email body <\/b>look at the\u00a0Add dynamic content<\/strong>\u00a0menu and you’ll see\u00a0Converted time<\/strong>\u00a0for each of the two actions that you added:<\/p>\n

\"\"<\/p>\n

You can select both items to put them into the body of the email. With all the various properties it could look like this in the Flow designer:<\/p>\n

\"\"<\/p>\n

Save your flow! Now, when you add a file to document library, you’ll get a new email that looks like this (showing the File properties on the top, and the actual email content on the bottom), notice the formatted date times that are in Pacific Time, not UTC:<\/p>\n

\"\"<\/p>\n

Adding to and subtracting times<\/h2>\n

Another common ask is to create a relative time in your flow – for example, to create a task that is due at the end of the day. We will use the new options in the\u00a0Recurrence<\/strong> trigger<\/a> to start this flow at 8am every weekday. Like with the first flow<\/a>, create from blank. This time, select the Recurrence trigger.\u00a0<\/p>\n

For the Recurrence pattern we want to select a Frequency <\/strong>of 1\u00a0Week<\/strong> (this may be counter-intuitive because the flow will run more than once per week1<\/sup>). Next, select\u00a0Show advanced options<\/strong>\u00a0and choose the time zone of your business. Then, under\u00a0On these days<\/strong>\u00a0select the weekdays, and finally At these hours<\/strong>\u00a0select 8.<\/p>\n

\"\"<\/p>\n

You should now see a preview that says\u00a0Runs at 8:00 on Monday, Tuesday, Wednesday, Thursday, Friday every week.<\/em><\/p>\n

Now you can select New Step and Add an action. In the search box enter\u00a0Get Future Time<\/strong>. For this action you’ll choose how many hours in the future you want the task to be due:<\/p>\n

\"\"<\/p>\n

Finally, you can add the task. Add an action and select where you want to task to be (for example Todoist). First, you will provide a Subject. Then, select\u00a0Due Date<\/strong>\u00a0and open up\u00a0Add dynamic content<\/strong>. Here, you’ll see the output for Future time<\/strong>. Select that and it’ll be included as the due date. You’re all set – now each weekday you’ll get a new task due for you at the end of the day.<\/p>\n

\"\"<\/p>\n

We hope you found these examples helpful, if you have any questions about how to work with Dates and Times, please reach out to us on the community<\/a>.<\/p>\n\n

1<\/sup> The recurrence frequency, when you use the advanced options, indicates how often the overall recurrence pattern repeats. Because we want the same pattern each week, the Interval and Frequency are set to 1 week. Then, inside of each week, you can have multiple days, or even hours, for the trigger to run at.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

Last month we announced new actions and expressions to help you work with dates and times<\/a>. This blog post will walk through in more detail how to use these new features – for example, to send an email with times in the appropriate time zones, or create a task that is due at a certain period of time each weekday.<\/p>\n","protected":false},"author":347,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","power-automate-category":[2836],"power-automate-tag":[],"coauthors":[2913],"class_list":["post-110916","power-automate","type-power-automate","status-publish","hentry","power-automate-category-walkthroughs"],"yoast_head":"\nWorking with Dates and Times inside of your flows - Microsoft Power Platform Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Working with Dates and Times inside of your flows - Microsoft Power Platform Blog\" \/>\n<meta property=\"og:description\" content=\"Last month we announced new actions and expressions to help you work with dates and times. This blog post will walk through in more detail how to use these new features - for example, to send an email with times in the appropriate time zones, or create a task that is due at a certain period of time each weekday.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Power Platform Blog\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/working-with-datetimes-file-trigger.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 min read\" \/>\n\t<meta name=\"twitter:label2\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data2\" content=\"Stephen Siciliano\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/\",\"name\":\"Working with Dates and Times inside of your flows - Microsoft Power Platform Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/working-with-datetimes-file-trigger.png\",\"datePublished\":\"2017-11-28T15:57:22+00:00\",\"dateModified\":\"2017-11-28T15:57:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#primaryimage\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/working-with-datetimes-file-trigger.webp\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/working-with-datetimes-file-trigger.webp\",\"width\":1226,\"height\":362},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Power Automate\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Working with Dates and Times inside of your flows\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\",\"name\":\"Microsoft Power Platform Blog\",\"description\":\"Innovate with Business Apps\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\",\"name\":\"Microsoft Power Platform Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"width\":194,\"height\":145,\"caption\":\"Microsoft Power Platform Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Working with Dates and Times inside of your flows - Microsoft Power Platform Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/","og_locale":"en_US","og_type":"article","og_title":"Working with Dates and Times inside of your flows - Microsoft Power Platform Blog","og_description":"Last month we announced new actions and expressions to help you work with dates and times. This blog post will walk through in more detail how to use these new features - for example, to send an email with times in the appropriate time zones, or create a task that is due at a certain period of time each weekday.","og_url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/","og_site_name":"Microsoft Power Platform Blog","og_image":[{"url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/working-with-datetimes-file-trigger.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 min read","Written by":"Stephen Siciliano"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/","name":"Working with Dates and Times inside of your flows - Microsoft Power Platform Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#primaryimage"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#primaryimage"},"thumbnailUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/working-with-datetimes-file-trigger.png","datePublished":"2017-11-28T15:57:22+00:00","dateModified":"2017-11-28T15:57:22+00:00","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#primaryimage","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/working-with-datetimes-file-trigger.webp","contentUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/working-with-datetimes-file-trigger.webp","width":1226,"height":362},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/working-with-dates-and-times\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/"},{"@type":"ListItem","position":2,"name":"Power Automate","item":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/"},{"@type":"ListItem","position":3,"name":"Working with Dates and Times inside of your flows"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/","name":"Microsoft Power Platform Blog","description":"Innovate with Business Apps","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization","name":"Microsoft Power Platform Blog","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","width":194,"height":145,"caption":"Microsoft Power Platform Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/"}}]}},"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Power Platform Blog","distributor_original_site_url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate\/110916"}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/types\/power-automate"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/users\/347"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/comments?post=110916"}],"version-history":[{"count":0,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate\/110916\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/media?parent=110916"}],"wp:term":[{"taxonomy":"power-automate-category","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate-category?post=110916"},{"taxonomy":"power-automate-tag","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate-tag?post=110916"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/coauthors?post=110916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}