-1

I'm creating a site using PHP, and it needs to display the time on the page according to the user's timezone.

After some searching, I couldn't find a server-side way to do it, and all of the solutions required detecting the timezone using JS and refreshing the page. Such as : PHP timestamp date to user timezone

Now, this works. I am saving the timezone on user's cookies so the site doesn't refresh again. But I'm wondering if there is an SEO penalty if the crawlers detect a refresh upon visiting a site/page for the first time?

Community
  • 1
  • 1
jaimeT
  • 133
  • 1
  • 15

1 Answers1

0

I would not advise a "refresh" when the user loads the page just for that. You can utilize the method recommended in the link you posted, and have PHP save the timezone to a cookie, so that it can read from that cookie next time the user loads the page.

An easy solution would be to display the time on the front-end in PHP, and use a JavaScript framework, such as Moment.js, to display in the user's current timezone.