Page 2 of 2

Re: If Time is Less than 24 hours Show Hours/Minutes/Seconds

Posted: Mon Oct 11, 2010 11:33 pm
by Jonah Bron
My guess is that there's a timezone issue. The timezone that your server is in is probably, oh say, maybe plus or minus 4 hours from you.

Try replacing

Code: Select all

$now = time();
$then = get_the_time('U');
With either

Code: Select all

$now = time() + (60*60*4);
$then = get_the_time('U');
or

Code: Select all

$now = time() - (60*60*4);
$then = get_the_time('U');
or

Code: Select all

$now = time();
$then = get_the_time('U') + (60*60*4);
or

Code: Select all

$now = time();
$then = get_the_time('U') - (60*60*4);
One of those for should work. I'm sort of tired, so I can't quite think hard enough to figure out which one :wink:

Re: If Time is Less than 24 hours Show Hours/Minutes/Seconds

Posted: Mon Oct 11, 2010 11:43 pm
by ccmovies
Excellent, I will try one of those in the morning. I am tired myself, and heading off to get some shut eye.

Re: If Time is Less than 24 hours Show Hours/Minutes/Seconds

Posted: Tue Oct 12, 2010 10:57 am
by Jonah Bron
Okay, I thought about it. It's either the second one or the third one. I think you want the third one. I think the second one will throw off date.

Re: If Time is Less than 24 hours Show Hours/Minutes/Seconds

Posted: Tue Oct 12, 2010 4:04 pm
by ccmovies
Jonah Bron wrote:Okay, I thought about it. It's either the second one or the third one. I think you want the third one. I think the second one will throw off date.
As far as I can tell, the third one works! Thank you so much!