[Timezone ?] Date de modification affichée incorrecte

More
4 years 8 months ago - 4 years 8 months ago #78277 by tonnick
Hello ! j'ai une page d'archive sur laquelle j'affiche la date de derniere mise à jour :
Code:
<?php $db = JFactory::getDbo(); $catid = JFactory::getApplication()->input->getInt('cid'); $query = 'SELECT modified FROM #__content AS c JOIN #__flexicontent_cats_item_relations AS rel ON c.id = rel.itemid WHERE rel.catid = ' . (int) $catid .' ORDER BY modified DESC LIMIT 1'; $db->setQuery($query); $most_recent_mod = $db->loadResult(); print $most_recent_mod ; ?>
hors l'heure est affichée avec une heure de moins !

J'ai vérifié la configuration sur Joomla, sur le serveur, et la date est la bonne partout ! meme dans l'admin, si je filtre sur la categorie et que je classe les artilces par modification, la date/heure sont correcte alors que sur le front, il y a cette heure de décalage !

Serveur :
# date
Sat Mar 28 13:43:15 CET 2020

mysql :
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'time_zone';
+
+
+
| Variable_name | Value |
+
+
+
| time_zone | SYSTEM |
+
+
+
1 row in set (0.00 sec)

une idee d'ou ca peut bien venir ?!
Last edit: 4 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #78280 by ggppdk
Hello

from what i understand the display of hours is shifted by some time

The time display in frontend will use the timezone of the logged user , and for visitors the it should be the timezone of the site's configuration


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #78281 by tonnick
time display in frontend is public, no need to be logged in. moreover, timezone from joomla configuration, server and visitor is same. so why is there this difference ? :( I'm becoming crazy with that, I cannot find any logical reason !

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #78283 by ggppdk
Hello

Are you using the date data as they are from the DB query

then
please note that DB date like created and modified are stored always as "UTC + 0"

so you will need to adjust them to the desired timezone


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #78286 by tonnick
ooo I never figure out than date in website was in fact "overwritten" by website settings. thx after googling a while, I added a piece of code to have the right date. thx for your lights !

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.364 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline