In this article, We learn how to convert UTC to PST with daylight saving using bing maps API. I will show you how and just follow the steps clearly.
For more updates please do Subscribe via Email:
What is UTC or PST?
UTC and PST is time zone with different setting time. UTC means Coordinated Universal Time or Universal Time Coordinated (UTC). And PST is Pacific Standard Time different from the UTC. actually there is many more time zone with different offset time. UTC has a 00:00 offset and PST has a -08:00 offset. Its means that PST is delayed eight hours from the UTC time zone.
What is Daylight saving?
Daylight saving time, also known as daylight savings time or daylight time, and summer time, is the practice of advancing clocks during warmer months so that darkness falls at a later clock time. Some time zone has daylight saving time that they are adjusting there time one hour backward from the original time and reset it after several months. for year 2022 the day light saving start from March 13 to November 6. The main purpose of this is to make better use of daylight or the sun light shine for the particular places.
Bing maps?
Bing maps is a web mapping service provided as part of Microsoft Bing suite of search engines. Currently, Bing Maps provides maps & level wise layouts of over 5300 venues across the world.
Bing maps API
Convert UTC Datetime to a Different Time Zone
Converts a datetime value in UTC format to local time in the specified time zone. The date component is used to determine the correct day light saving settings.
https://dev.virtualearth.net/REST/v1/TimeZone/Convert/?datetime={datetime_utc}&desttz={timezoneid}&key={BingMapsKey}
API Parameters
Parameters | Alias | Descriptions | Values |
---|---|---|---|
dateTime | dt | Required. The UTC date time string for the specified location. The date must be specified to apply the correct DST. | The date time string must be in UTC format. If the date is not included, the returned time zone information may be incorrect. Example: 2018-05-15T13:14:15Z |
desttz | Required. The ID of the destination time zone. The value of datetime will be converted to the local time of this time zone. | Any valid IANA or Windows time zone name. Examples: – Americas/LosAngeles – Cape Verde Standard Time | |
includeDstRules | Optional. If set to true then DST rule information will be returned in the response.Note: For information about DST rules, see the DSTRule Resource. | Either true or false .Default: false | |
output | o | Optional. Output format of the response. | Format of the response: – JSON – XML Default: JSON |
Create Bing Maps Key
One of the required parameter is the value of key which is the BingMapsKey. In order to generate that key you need to visit this link and sign-in.
First create a account details under the my account tab.
Next create a key by navigating it in My keys under the my account tab. Filled up the necessary fields to create the Bing Maps Key.
This is the case when you are created the key details. You can copy the key directly via hitting the button copy key and enable a visibility of the key by hitting the Show key link button.
Output
I try to execute the API using postman software.
Output response
{
"authenticationResultCode": "ValidCredentials",
"brandLogoUri": "http://dev.virtualearth.net/Branding/logo_powered_by.png",
"copyright": "Copyright © 2022 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": "Pacific Standard Time",
"abbreviation": "PST",
"ianaTimeZoneId": "America/Los_Angeles",
"windowsTimeZoneId": "Pacific Standard Time",
"utcOffset": "-8:00",
"convertedTime": {
"localTime": "2022-06-14T18:30:30",
"utcOffsetWithDst": "-7:00",
"timeZoneDisplayName": "Pacific Daylight Time",
"timeZoneDisplayAbbr": "PDT"
},
"dstRule": {
"dstStartMonth": "Mar",
"dstStartDateRule": "Sun>=8",
"dstStartTime": "2:00",
"dstAdjust1": "1:00",
"dstEndMonth": "Nov",
"dstEndDateRule": "Sun>=1",
"dstEndTime": "2:00",
"dstAdjust2": "0"
}
}
}
]
}
],
"statusCode": 200,
"statusDescription": "OK",
"traceId": "d284d20d0ddfad6|PUS0004C6E|0.0.0.1"
}
Happy Learning..
Thank you for visiting my blog site. Hoping you learn more here. please feel free to comment and suggest if there is need to enhance and update. thank you.
Related Topics
UTC to PST conversion with daylight saving time
In this article, We learn how to convert UTC to PST with daylight time saving using azure maps API. I will show you how and […]
How to convert UTC datetime to different time zone with daylight saving using Bing maps API
In this article, We learn how to convert UTC to PST with daylight saving using bing maps API. I will show you how and just […]
Azure Active Directory get access token using Postman
In this article, We learn how to get access token in AAD using Postman. I will show how to do it, and just follow the […]
.NET Core API using Entity Framework (EF) Code First Approach
In this article, I will show how to create .NET Core API using Entity Framework Code First Approach. I will develop Student Web API application […]
One Reply to “How to convert UTC datetime to different time zone with daylight saving using Bing maps API”