|
Same here.
Posted 91 months ago.
(permalink)
|
|
I'm seeing the same thing.
Posted 91 months ago.
(permalink)
|
|
I guess I'll add my two cents as well...Me Too! Actually all the posts previous to the install are fine but the one after are as mentioned above. And it seems that when I save the entry it takes forever or just keeps thinking (loading).
Posted 91 months ago.
(permalink)
|
|
Hmmm...this is very strange. When I got home today to review the new action on my blog I noticed that the "Time Since" is now correct. It was -1 year, and whatever else, but now it's right all of a sudden. I didn't change anything.
See here: www.adamstac.com
Posted 91 months ago.
(permalink)
|
|
mine does it too
Posted 91 months ago.
(permalink)
|
 |
Guillaume [Sweet As A Cactus] [deleted] says:
Same problem.
Posted 91 months ago.
(permalink)
|
|
WTF?!... Well color me dumbfounded. I wish I could be of help, but since I pretty much just hacked the plugin into submission, I have no idea :)
Posted 91 months ago.
(permalink)
|
|
hehe, I cant see why and Ive double checked the version many times.
Odd thing is, Im sure after initially replacing the beta version, that it worked.
Oh well.
Posted 91 months ago.
(permalink)
|
|
Ok..it seems like the new post that are submitted are incorrect until a certain time then then plugin gets it right. Maybe after a while the time syncs up or something...I'm not sure. But when I post a new post the "Time Since" is wrong, but then after a certain ammount of time it becomes correct...very strange!
Posted 91 months ago.
(permalink)
|
|
I had that problem too.
It's solved by messing with the time settings vs. GMT in the WP Options.
don't ask me, but this is the only way i've managed to work around it.
i mean, who cares if the + or - setting is not accurate, as long as your actual date and time are correct in the post, right?
Posted 91 months ago.
(permalink)
|
|
I thought the same, but mine is correct as 0. I tried altering it +/- a bit but still no joy.
oddly enough, I *JUST* did a new post and thats fine
Posted 91 months ago.
(permalink)
|
|
Yes,
once you fix the time setting in options, you need to reset the time stamp in your wonky posts.
sorry for not mentioning this before.
F.
Posted 91 months ago.
(permalink)
|
|
Well folks I think I've figured out what's going on. If you invoke the routine the way they recommend in the plugin:
$entry_datetime = abs(strtotime($post->post_date)); echo time_since($entry_datetime) ?> ago
Then you're passing in time that's already been adjusted from GMT to your local time. However, in the plugin there's another attempt at adjusting from GMT at this line:
$newer_date = ($newer_date == false) ? (time() +(60*60*get_settings("gmt_offset"))) : $newer_date;
To correct this, simply delete the entire clause for the adjustment, like so:
$newer_date = ($newer_date == false) ? time() : $newer_date;
Hope this helps someone.
Posted 91 months ago.
(permalink)
|
|
well done!
thanks!!!
Posted 91 months ago.
(permalink)
|
|
This is still plaguing me...I love this plugin I just wish that it worked. I tried what you said ColdForged, but it came up null. Sigh!
EDIT!!!!
WooHoo!!! I just figured it out!! My server is in a different time zone than I am. In the WordPress options I had the time offset to the time zone that I am in not the server but the plugin must be getting the GMT offset time from the server itself and not the wordpress setting.
I do want to add that the removal of the string mentioned above did the trick as well after I correctly set my offset.
Much thanks ColdForged!!!
Posted 91 months ago.
(permalink)
|
|
Yay! You had me worried ;).
Posted 91 months ago.
(permalink)
|
 |
orsix [deleted] says:
I was just wondering if all I have to do is drop this in my plugins folder and activate it? Or do I need to edit some .php? 'Cuz I've already activated the plugin and I don't see any difference.
I'm a little nervous about just going in the .php files and trying to figure this out myself. I might cause it to explode. So I was hoping that someone could let me know what I need to do, like having to edit the index.php or any other files? Any help would be greatly appreciated.
Posted 91 months ago.
(permalink)
|
|
Yes you do have to edit some php files, presuming youre using Kubrick (as this is that group) then if you look in the php files you should finf some lines commented out with descriptions.
Remove the either side of the code AND the comments if there are any to make it work.
Aside from that the instructions with the plugin should explain it.
If youre a php n00b then dont expect a magic fix, youll have to get your hands somewhat dirty with php.
Posted 91 months ago.
(permalink)
|
|
I guess my server is somewhere in Australia (hehe) and me is living and blogging from Western Europe Time (netherlands) I did the adjustment. but not working (new posts not even) tried some combinations and yeah..
what do i have to change more, I think i'll sniff into some sources.
best regards
Posted 91 months ago.
(permalink)
|
|
mine doesnt always seem to work properly (after the above alteration) and my servers in my same timezone
Posted 91 months ago.
(permalink)
|
|
I tried ColdForged's fix and switched the offset to my server's timezone, and it works. The only issue now is that the actual post time, the_time() , returns a time that is 3 hours earlier than the actual post. Is there a way to fix that?
Posted 91 months ago.
(permalink)
|
|
Here's a funny one...
i was enjoying the fix here for a while, with 1.2, 1.2.1, and various 1.3aX installs.
i updated to 1.3a6 and it was wrong again.
put the old code back:
+(60*60*get_settings("gmt_offset"))) : $newer_date;
and it's correct again.
*shrug*
Posted 91 months ago.
(permalink)
|
|
I was messing around with the plugin and saw that it was always adding the timezone to the timestamp, and the timestamps are not GMT, they contain the server's time offset, so it is screwing up unless the server's timezone is +0000 or that the timezone setting in WordPress is +0000.
I was playing around with it and built this, while not the best code, it did resolve it on my blog. Go here.
DO note that it doesn't detect if the server is on DST and if there is a non-DST timezone (like mine) it might appear one hour off. I think this is NOT revelant as it is time since the time since is not DST-aware.
Regards,
Samuel
Posted 90 months ago.
(permalink)
|
|
Samuel, I tried your code and although it does make the time work, I keep getting an error message whenever I try to post a comment on my site. It gives me some sort of error about the header already being passed and cites the file wp-comments-post.php. The comment still gets posted, but not without the error message first.
If I could get rid of those error messages it would be perfect.
Posted 90 months ago.
(permalink)
|
|
I do think I know what that is, check you have the latest one above... I changed 4 hours after I posted (left a debug echo in there).
Posted 90 months ago.
(permalink)
|
|
Samuel, let me help you out and be more specific. The error I get is the following:
Warning: Cannot modify header information - headers already sent by (output started at /disk3/home2/web/beginner/rsalvi/rehanalvi.com/www/blog/wp-content/plugins/timesince.php:110) in /disk3/home2/web/beginner/rsalvi/rehanalvi.com/www/blog/wp-comments-post.php on line 180
However, the file that I call the time_since thing is NOT from wp-comments-post.php, I instead add the line to the WP-DROPDOWN-COMMENTS.php file, since I am using dropdown comments. But the error shows something happening in wp-comments-post.php. Also, I get this error when I attempt to make a change to wp-dropdown-comments.php through the WP template admin and then save it. Comments still get posted, but not without the error message. If you use AIM, you may contact me on NeuroCide5 if you need me to explain this better. Thanks a lot.
Posted 90 months ago.
(permalink)
|
|
when i used coldforged's tip, my posts were 5 hours late... and when I tried to adjust my GMT settings, even to -200 + 20000 it still stayed 5 hours late.
Posted 90 months ago.
(permalink)
|
|
try changing
$since = $newer_date - $older_date;
to
$since = abs($newer_date - $older_date);
Posted 90 months ago.
(permalink)
|
|
Has anyone had this problem in WP 1.5? While previously running 1.2.2, I used ColdForged fix from this thread and it worked fine. But after upgrading to 1.5, it's no longer working. The code in the plug-in is all still the same (with the fix).
I tried d723's change, and that made it stop displaying the negative year, but it was displaying the time two hours wrong. (I checked my time adjustment in WP, and that's correct).
Anyone else experienced this?
thanks!
Posted 89 months ago.
(permalink)
|
|
Well, I grabbed Blue Dragon's version from above, and that did it! thanks!
Posted 89 months ago.
(permalink)
|
|
Yeah...Blue Dragon's version did the trick for me too. Thank you so much man...this has been bugging me forever.
Posted 88 months ago.
(permalink)
|
 |
Jussi Boy [deleted] says:
Ohh Bluedragon! You rock!
Posted 88 months ago.
(permalink)
|
|
For 1.2 blogs the minimalist fix below works (and it's pretty simple, too):
www.flickr.com/groups/topic/15535/
For 1.5 there may be problems (not sure, since I'm still on 1.2).
Update: 1.5 works fine for me.
Posted 88 months ago.
(permalink)
|
|
I was gettting "-1 year..." thing with every code posted here (in WP 1.5) which really pi**ed me off, since it's a great feature to have.
After loosing some 2h of my sleep time, I think I managed to make this thing to work.
I use post_date_gmt and comment_date_gmt in all templates. And I use the variation of Blue Dragon's code:
$curtime = time();
$offset = date("O");
if ($offset != "+0000") {
if (strstr($offset, "-")) {
$offset = (integer) str_replace("-", "", str_replace("0", "", $offset));
$curtime = $curtime + (60*60*$offset);
} elseif (strstr($offset, "+")) {
$offset = (integer) str_replace("+", "", str_replace("0", "", $offset));
$curtime = $curtime - (60*60*$offset);
}
}
$newer_date = ($newer_date == false) ? $curtime : $newer_date;
This works on both my local server (UTC+1) and live server (UTC-8).
Posted 88 months ago.
(permalink)
|
|
Blue Dragon, that was EXACTLY what I needed! Thanks a million!
Posted 88 months ago.
(permalink)
|
|
Thanks Blue Dragon, your file fixed my problem! w00t!
Once more, with feeling...
Posted 88 months ago.
(permalink)
|
|
I'm getting the same problem as eleven26 of the times being two hours off. Right after I post a comment or entry, it displays it as 2 hours old.
I'm using a clean install of 1.5 with Blue_Dragon's hack above:
blue-dragons-lair.net/wp-content/plugins/timesince.phps
I wonder if everyone else who posted to this thread saying Blue_Dragon's file works just didn't notice that they were all two hours off because they don't have any very recent posts. Hmmm. I wish I knew more PHP so I could fix this. Anyone have any ideas?
Posted 88 months ago.
(permalink)
|
|
rather have two hours off, than a year! LOL
Posted 88 months ago.
(permalink)
|
|
I agree. I can live with the two hours off problem. I just wish I knew how to fix it...
Posted 88 months ago.
(permalink)
|
|
Mine isn't 2 hours off...and I'm using Blue Dragon's hack.
Posted 88 months ago.
(permalink)
|
|
The "-1 year" and "two hours off" stuff are due to improper consideration of timezones when the date conversions are done.
Replace the call to time_since() with the following, and everything should be okay:
<?php echo time_since(abs(strtotime($post->post_date_gmt . " GMT")), time()); ?> ago
Assuming that your wordpress has been configured properly, the post_date_gmt should be the true GMT of when the post was created. Appending " GMT" to it before converting to a (timezone-free) Unix time ensures that things stay in sync. Then, passing the current time() (which is timezone free) as the 2nd arg overrides the silly timezone calcs done within time_since, ans voila, you have a true "time since" that works across timezones, daylight savings times, lunar eclipses, and leap years.
Jeffrey
Posted 87 months ago.
(permalink)
|
|
GREAT!!!!!
What about the commments or 'after the fact'?
Posted 87 months ago.
(permalink)
|
|
For comments:
comment_date_gmt . " GMT")), time()); ?>
how do you put code in here?
Posted 87 months ago.
(permalink)
|
|
This has been noted: www.blue-dragons-lair.net/archives/2004/12/28/date-glitch...
Posted 86 months ago.
(permalink)
|
|
I've been trying your update Sam and for some reason, I've been coming up with -36 years, 5 months ago for some reason. Any idea why that's happening?
Posted 84 months ago.
(permalink)
|
|
I'm glad I'm not the only one who has this reather annoying issue.
Posted 83 months ago.
(permalink)
|
|
Using Blue Dragon's idea it changes ALL my posts to -36 hours ago
Posted 83 months ago.
(permalink)
|
|
binarybonsai.com/archives/2005/07/11/time-since-is-broken...
Posted 83 months ago.
(permalink)
|
 |
Sam- [deleted] says:
FYI - jfriedl's response is what got me the solution! tks!
Posted 40 months ago.
(permalink)
|
Would you like to comment?
Sign up for a free account, or sign in (if you're already a member).
|