Places UI Kit: A ready-to-use library that provides room for customization and low-code development. Try it out, and share your input on your UI Kit experience.

Place Field Migration (open_now, utc_offset)

  • 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.

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:

newgoogle.maps.places.PlacesService(attrContainer).getDetails({
placeId:'...',
fields:['opening_hours','utc_offset_minutes'],
},function(place,status){
if(status!=='OK')return;// something went wrong
constisOpenAtTime=place.opening_hours.isOpen(newDate('December 17, 2020 03:24:00'));
if(isOpenAtTime){
// We know it's open.
}
constisOpenNow=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.

  • openNow:false returns all places.
  • openNow:true returns 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年11月21日 UTC.