web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : QgihTB1eRIdpLtKZArYSrn
Power Automate - Building Flows
Answered

Get time for a city

Like (0) ShareShare
ReportReport
Posted on 9 Jul 2020 14:53:09 by

Hi

 

Similar as the Weather connector, Is there any connector to get time on a certain city if someone input the name of the city as a trigger?

 

Thanks

 

Ezequiel

 

I have the same question (0)
  • Verified answer
    Rodrigo Hentz Profile Picture
    on 09 Jul 2020 at 17:37:06
    Re: Get time for a city

    Hi @ezequiel how are you?

     

    @ezequiel unfurtunately we do not have yet an action to do that, but I think you can use a combination using Bing Maps connector and also the Bing Maps API in a HTTP request.

     

    Using the Bing Maps connector you can use the "Get location by address" action https://docs.microsoft.com/en-us/connectors/bingmaps/#get-location-by-address . This will return the point of the location on the map.

     

    After that you can use the Bing Maps API calling the timezone service to get the current time as descibed on https://docs.microsoft.com/en-us/bingmaps/rest-services/timezone/find-time-zone#return-time-zone-information-in-json-for-a-location-point passing the location point 

     

    Do not forget to create first a Bing Maps Key for that at https://docs.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key

     

    My sample here was a manually trigger flow adding the city and country.

     

    Full sampleFull sample

     

    At the Parse JSON action, you can add this to generate the object clicking on "Generate from sample" button. This is the body of the output of the HTTP action.

     

    {
    "authenticationResultCode": "ValidCredentials",
    "brandLogoUri": "http://dev.virtualearth.net/Branding/logo_powered_by.png",
    "copyright": "Copyright © 2020 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
    "resourceSets": [
    {
    "estimatedTotal": 1,
    "resources": [
    {
    "__type": "RESTTimeZone:http://schemas.microsoft.com/search/local/ws/rest/v1",
    "timeZone": {
    "genericName": "Romance Standard Time",
    "abbreviation": "CET",
    "ianaTimeZoneId": "Europe/Paris",
    "windowsTimeZoneId": "Romance Standard Time",
    "utcOffset": "1:00",
    "convertedTime": {
    "localTime": "2020-07-09T19:02:33",
    "utcOffsetWithDst": "2:00",
    "timeZoneDisplayName": "Romance Daylight Time",
    "timeZoneDisplayAbbr": "CEST"
    }
    }
    }
    ]
    }
    ],
    "statusCode": 200,
    "statusDescription": "OK",
    "traceId": "0b124377cdb0400e8c0465d8a99d21e4|CH000010A4|0.0.0.1"
    }

     

    This is the formula used to get the value on the Notification action

     

    body('Parse_JSON')['resourceSets'][0]['resources'][0]['timeZone']['convertedTime']['localTime'
     
    I hope that this can help you on your question.
     
    Regards.
     
    Rodrigo Hentz
    Microsoft Support Engineer
  • Rahber Profile Picture
    1,935 on 09 Jul 2020 at 17:27:58
    Re: Get time for a city

    Nop. But you can use the HTTP Api to get the time from any other API such as http://worldtimeapi.org/

     

    Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

    Thanks,

    Rahber

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 809 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 712 Super User 2025 Season 2

#3
stampcoin Profile Picture

stampcoin 373 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete