Where does the Timezone show in the code?
-
We have been alerted to an possible issue on a website we look after, in Germany.
It states there is no Language on the code. It’s basic HTML so I can add it in – however, when i check the Lang code on their WP site, even tho it shows UK English as Lang, and location as Berlin, the Lang is en-GB. Should that not also show their timezone in some way?
I assumed it would be en-GR or whatever it is for Germany…?
Thanks.
-
There is only one time zone in Germany. Central European Time (CET) UTC+1 is used as standard time, while Central European Summer Time (CEST) UTC+2 is observed when Daylight Saving Time (DST) is in force.
You can easily select it from wp-admin dashboard / Settings/General then scroll down to middle and you will find Site Language & Timezone
You will also find code in wp-admin/options-general.php file.
Hope this helps.
Thanks for that. It is all set, but where does one find it in the code, so that scanners and other such crawlers can see it?
I would recommend selecting “Berlin” for Germany under Settings > General > Timezone. This will allow PHP to handle all time zone specifics (daylight saving time, etc.).
Yes that is already set. But where in the view source does one see this in action? I assumed it would be in the <htm> code with the lang, or in Meta somewhere?
No, the information here is interpreted by PHP when a function requests it (e.g., to output the date of a post in the backend).
There are two pitfalls here:
- A plugin could override this setting. I have encountered two in the past that interfered here, leading to discrepancies in PHP’s interpretation. I would therefore recommend that you rule out plugins as the cause of your problem by deactivating them all.
- If the output you are checking is generated with JavaScript, then it is an individual output. Depending on where the JavaScript comes from, the cause can be completely different.
Overall, it can therefore be said that without more detailed information from you, e.g., a link to the page in question, not much more can be said about it. This has nothing to do with information in the HTML code, as no time zones are specified in HTML.
This is the website. What codes should be appearing? I assumed it would be tghe lang code, that was en-Gb, but the GB be another code.
I think you’re still confusing things. Now that we see the website, however, we can help you even better.
I see that it’s a website with a
.dedomain, but it’s entirely in English. That’s fine, you can do it that way – it will just confuse German-speaking visitors. The language is set toen-gb, which probably means that the target audience for the company behind the website is Great Britain.The time zone is set to
Europe/Berlin, which is correct if you want to use the German time zone as the base. Again, this has absolutely nothing to do with the language setting. You could also have a Chinese website and set the time zone toEurope/Berlin– that could be confusing for visitors when displaying dates, but it’s certainly doable. However, language and time zone are technically unrelated at all.When I look at the blog on the website, I see two different date formats. One shows the date in German notation
dd.mm.YYYY, and the other shows the English notationm d, Yon the right side of the Recent Posts. The “Recent Posts” widget actually belongs to WordPress, but normally displays the date format set in WordPress. I can’t tell why this isn’t happening for you. You’re using Porto, a commercial theme, which we don’t have access to here, and therefore we can’t help with. If you have any questions about this date format, please contact their support: https://themeforest.net/item/porto-responsive-wordpress-ecommerce-theme/9207399/supportUnfortunately, I don’t see any time display on the website, so I don’t know how you got to the time zone issue? Does it have something to do with orders in the shop? Feel free to send a more detailed link (not to the backend; we don’t want to have access to the backend here) or a screenshot of the location you’re referring to, see:
Hi.
Where does it show europe/berlin in the code?
Yes it is English speaking. But they are based in Germany.It’s not in the code anywhere because it’s not output in the HTML code of the page. However, I can read it via the REST API (under
/wp-json/, as it’s public data).In order to answer your actual question, we still need answers to the above questions.
so I don’t know how you got to the time zone issue? Does it have something to do with orders in the shop?
If you want to show a screenshot, see: https://wordpress.org/support/forum-user-guide/block-editor/#adding-screenshots
No the problem came about as a scanner showed some internal code on non-WP was missing Language code. When I checked what the code was, it dawned on me that whiel you set the location in settings, it doesn’t actually show it in any code. Which made me question… why set it all?
It’s not related to the shop.
As described above, the time zone setting is used to display date and time information in the format appropriate for the website. This is done using PHP functions that receive the date (e.g. the post date from database), recognize the time zone in it, and then use the desired time zone for the output.
I don’t understand the connection with the scanner (which one?), the missing language-code and why there is no connection with the website if you are still asking about it?
For some reason the rest of this thread is not appearing.
I thought the timezone would show in the code somewhere, since the Lang does.
Does the timezone not show on pages like the homepage?Again: no.
alas no replies are showing so I can’t see what your “again: no” is a reply to.
doesn’t help when the thread is missing.
Moderator side note: Pagination can get confused when links get sent about replies. The whole thread is here. Edit te URL in your browser to remove “/page” and everything after.
We now return you to your topic….
The topic ‘Where does the Timezone show in the code?’ is closed to new replies.