3 different times on my WordPress website

In short, the server shows 13h (correct in current time in São Paulo DST), but PHP shows15h and WordPress shows 12h.

This is intentional, and needs additional clarification, but to expand you have:

  • The server local time
  • UTC timestamps
  • Localised WP time

These needs to be separate, e.g. if I host a Japanese website on a server in Moscow:

  • The server local time would be that of Moscow
  • UTC Timestamps are timestamps, they’re always UTC
  • Local WP time would be UTC timestamp + offset, aka whatever offset Tokyo time is.

It would seem that your local WP install is configured with the wrong timezone

How to regularize this, that is, that the 3 cases have the same time?

You don’t, your mental model of how it works is incorrect.

WordPress stores all times in UTC as timestamps. Timestamps are not localized, 12pm UTC for me, is 12pm UTC for you no matter which timezone you are in. WordPress then adds or subtracts an offset based on the desired display timezone.

It’s that offset that you need to change, and that’s what the timezone setting does, which is exactly what the description on the setting says:

enter image description here

Clearly whatever value your site has in that drop down was chosen incorrectly, perhaps daylight savings was not taken into account ( e.g. if you’re in a UTC+4 timezone, and daylight savings jumps forward an hour, you are no longer UTC+4, you’re in UTC+5 )

As for server time, if you’re in PHP you’ll have to convert it to UTC first, or request it in UTC. It might also work to format the server time as a timestamp making sure to include the timezone/offset, but this will only work with newer PHP datetime APIs

You may also find this useful in understanding the difference between a time and a timestamp with regards to timezones