AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

My Business
1.8K members online now
1.8K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Unable to set AM/PM in Regular and Special Hours for 12hour time

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

 Hi,

 

I'm trying to create locations data using GMB API but I'm unable to create locations which has AM/PM in Regular and Special Hours. I'm getting Google.Apis.Requests.RequestError Request contains an invalid argument. [400]" message whenever location time has AM/PM in request. Please advise.

 

Thanks,

Deependra

1 Expert replyverified_user

Re: Unable to set AM/PM in Regular and Special Hours for 12hour time

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

It needs to be in 24 hour format

openTimestringTime in 24hr ISO 8601 extended format (hh:mm). Valid values are 00:00-24:00, where 24:00 represents midnight at the end of the specified day field.

 

https://developers.google.com/my-business/reference/rest/v3/accounts.locations#BusinessHours

Re: Unable to set AM/PM in Regular and Special Hours for 12hour time

Google Employee
# 3
Google Employee

Hi @Deependra P,

 

The openTime and closeTime fields of the TimePeriod object for regularHours as well as the openTime and closeTime fields of the SpecialHourPeriod object for specialHours have a specification for value that requires time in 24hr ISO 8601 extended format (hh:mm). Valid values are 00:00-24:00, where 24:00 represents midnight at the end of the specified day field. This means that the Google My Business API only accepts business hours in the Military 24-hour clock time format and not the AM/PM 12-hour clock time format. Please convert your business hours from the AM/PM 12-hour clock time format to the Military 24-hour clock time format when sending requests to modify your business hours.

 

Thanks,

Terry