Logs everything 6 hours ago
-
Hello!
In the logs, Streams marks all instant changes like happening 6 hours ago. I think this is a timezone misconfiguration. Can I do anything?
It’s already ok in Settings->General
Thanks,
FG
-
Hi FG!
Any chance this could be caused by another plugin you have activated?
Also, as a disclaimer: We are now undergoing a large data migration to a new set of servers. The good news is that data is still being captured by Stream, however reading that data back is intermittently in and out. We’ve also disabled new signups and reconnections at this time until the migration is complete.
Hi Frankie!
Honestly I’ve no idea if another plugin is causing this, I’ll check.
We had some Stream API errors, maybe this is because of the migration?
Yes, those errors will be happening intermittently until migration is complete. But again, Stream is still capturing records it just may not display them.
Ok, good to know!
Hey FG, just wanted to circle back around to our discussion here.
Have you tried disabling plugins to see what might be the culprit here?
1. The
WP_Stream_Logclass is where the record’screateddatetime is declared before it gets passed off to our API.2. This date value is generated by the
wp_stream_get_iso_8601_extended_date()function, which bases everything off of the PHPmicrotime()function which returns the current Unix timestamp in microseconds.3. So in summary, the
createddatetime should always be in GMT when it’s sent to Stream.If you are unable to isolate which plugin is causing the problem, I think a good next troubleshooting step would be to call the
wp_stream_get_iso_8601_extended_date()function by iteself somewhere in your theme and see if it’s displaying the current GMT time correctly or not.Hey FG, just following up again.
I think the problem could be the local system time on your computer, not the server.
It turns out that the timeago jQuery plugin we use for calculating time bases the relative time strings off of the browser’s time, which is the system time.
Your system time and your site’s timezone must be 6 hours apart. Please let me know if this is not the case.
Hi Frankie!
I’ve been with little time lately, so haven’t had the opportunity to test it all. Thank you for further investigating this.
I think I’ve found the problem, but don’t know how to fix it. Web have this in our functions.php:
date_default_timezone_set('America/Argentina/Buenos_Aires'); setlocale(LC_TIME, "es_ES");So yeah, ‘date_default_timezone_set(‘America/Argentina/Buenos_Aires’);’ is what makes Stream time travel.
We are using that so that we can echo the post time like this:
<time class="post_time" datetime="<?php the_time('Y-m-d H:i'); ?>"><?php the_time('j M'); ?> <?php the_time('g.i'); ?></time>Now I think we are doing things quite wrong…
Should we use somethink like ‘get_post_time(‘Y-m-d H:i’);’, ‘get_post_time(‘j M’);’ and ‘get_post_time(‘g.i’);’ and remove that line from functions.php?Honestly, I’m new to get_post_time() and don’t really know if it’s what we need. I’m testing it right now.
Thanks,
FGHi FG,
The
get_post_time()does the same thing asthe_time(), except it returns the value instead of displaying it.So
<?php echo get_post_time() ?>is the same as<?php the_time() ?>.I think all you need to do here is remove the
date_default_timezone_set()from yourfunctions.phpand make sure the Timezone field under Settings > General is set to Argentina – Buenos Aires.Sincerely, I don’t really know why date_default_timezone_set() was there in the first place… since the Timezone field under Settings > General was, and has always been, ok.
I do remember that we where having some problems when echoing the post publish time. But maybe it was because of another plugin we ended up removing, which were quite a few.Anyway, thank you very much for helping us solve this problem! Even when it was not because of Stream.
Great! Glad we got to the bottom of it!
The topic ‘Logs everything 6 hours ago’ is closed to new replies.