![]() sourceTimeZone – I’ve hardcoded this to be ‘UTC’ in my Flow, but you could get the current User’s timezone in your own scenario to set it dynamically, or set it to any other timezone.timestamp – I’m using the utcNow() expression to get the current date and time, but of course you could pass in any value from your trigger to here.The schema that we use for the Parse JSON step is:ĬonvertTimeZone(utcnow(),'UTC',items('Apply_to_each'), 'dd MMMM yyyy hh:mm tt') Parse JSON – next we run a Parse JSON step on the TimezonesArray variable so we can access the array item values for use in our Apply to Each loop. The full array is included in the Flow that you can download by clicking the link at the bottom of this post.Ĥ. The array contains information on the Time Zone including the name, it’s UTC offset, a description of some of the cities where it has effect, and the country of origin. "Description": "Belgrade, Bratislava, Budapest, Ljubljana, Prague", "Timezone": "Central Europe Standard Time", "Description": "Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius", I’ve included an extract of the array below: Intialize TimezonesArray array variable – next we’ll create an array variable that we will populate with our array of time zones for conversion. Initialize ConvertedTimes string variable – we’ll create an empty string variable called ConvertedTimes that we will use to capture the outputs when we loop through the time zones later in the Flowģ. Trigger – for the purposes of this demo I’m using a manual trigger, but you could of course use any trigger that gives you a time and date you want to work with.Ģ. In the Flow below I’m going to create an array of time zones using the data from the table on the Windows Default Time Zones page I linked above, and then I’ll convert the current UTC time to each of those to generate an output.ġ. ![]() If you’ve read any of my recent posts, you’ll be aware that I’m a big fan of arrays, and this is a perfect opportunity to use one. Note: if you’d like to see how to achieve the same functionality using a Select action instead of an array then read Pieter Veenstra’s excellent post on the topic. If you’ve had to convert one time to multiple different time zones all at once then it very quickly becomes a pain to create a Flow as it requires a new action for each conversion.ĭid you know that Microsoft supports 250 different time zones? If you wanted to see your local time represented in all of these different time zones all at once then it would be really inefficient to create a Flow for this, so how could we do it? If you’ve ever had to convert a timezone with Power Automate then you’re hopefully aware that there is a “Convert Time Zone” action that is designed to make this process easier for you.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |