A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/maps/documentation/javascript/place_field_js_migration below:

Place Field Migration (open_now, utc_offset) | Maps JavaScript API

Place Field Migration (open_now, utc_offset)

Stay organized with collections Save and categorize content based on your preferences.

The Places fields opening_hours.open_now and utc_offset are deprecated as of November 20, 2019, and will be turned off on February 20, 2021. These fields are deprecated ONLY in the Places Library, Maps JavaScript API. This guide shows you how to update your code to stop using these fields.

opening_hours.open_now field

This section shows how to update this functionality for each type of Places request.

Place Details requests

The opening_hours.open_now field is replaced by the opening_hours.isOpen() method.

For Place Details requests, instead of requesting opening_hours.open_now in the fields request parameter, include opening_hours and utc_offset_minutes in the fields request parameter, then call the opening_hours.isOpen() method on the returned google.maps.places.PlaceResult object to check whether the place is open. The following example shows a Place Details request that determines whether a place is open:

new google.maps.places.PlacesService(attrContainer).getDetails({
  placeId: '...',
  fields: ['opening_hours','utc_offset_minutes'],
  }, function (place, status) {
    if (status !== 'OK') return; // something went wrong
    const isOpenAtTime = place.opening_hours.isOpen(new Date('December 17, 2020 03:24:00'));
    if (isOpenAtTime) {
        // We know it's open.
    }

    const isOpenNow = place.opening_hours.isOpen();
    if (isOpenNow) {
        // We know it's open.
    }
});
Find Place requests

For Find Place requests, there is no replacement for the opening_hours.open_now field. We recommend making a Place Details request to get opening_hours information.

Nearby Search & Text Search requests

For Nearby Search and Text Search requests, you can use the openNow request parameter, which has the effect of filtering results to include only places that are currently open.

To list all places AND indicate openNow status, first make a request using openNow:false to get all places, then make a request using openNow:true to get open places only. Then, merge the responses.

utc_offset field

In Place Details requests, the utc_offset field is replaced by the utc_offset_minutes field. Simply replace occurrences of utc_offset with utc_offset_minutes in the fields request parameter, and when reading this information from PlaceResult.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-09 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-09 UTC."],[[["The Places fields `opening_hours.open_now` and `utc_offset` are deprecated and will be turned off on February 20, 2021 in the Places Library, Maps JavaScript API."],["For Place Details requests, use the `opening_hours.isOpen()` method and include `opening_hours` and `utc_offset_minutes` in the `fields` request parameter instead of `opening_hours.open_now` and `utc_offset`."],["For Find Place requests, it is recommended to make a Place Details request to get `opening_hours` information."],["For Nearby Search and Text Search requests, use the `openNow` request parameter to filter results based on open/closed status."],["Replace `utc_offset` with `utc_offset_minutes` in Place Details requests for the UTC offset information."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4