PDA

View Full Version : Fixing Time Display?


Seuss
01-19-2005, 06:10 AM
Wasn't sure if I should put this in Addons or Support but I'm gonna put it here.

I'm wondering if there's some way of off setting the time displayed when an image is posted. I'm guessing that Pixelpost pulls the time off the server it's on but that isn't necessarily the same time that the user might be at. For example if I were to post at 12:00 PM Pixelpost actually sees the time as 2:00 PM as my host is on the East Coast. I've briefly gone through the scripts (really quick) and haven't seen anything capable of changing this. Was wondering if we might be able to get a simple option in the next version to simply add or subtract time, like +2 hours or -2 hours. Then again maybe I'm blind and that option is in the scripts already :P

Connie
01-29-2005, 05:42 PM
as it was mentioned in another posting, this is a whish and for sure it is on the whishlist!

Anonymous
01-29-2005, 10:04 PM
I think something like this would be needed:

<?php

class MyTimeZone {

const TIMEZONE_SERVER_OFFSET = -5; // your server's offset from GMT 0

public function timeOffset($offset = null)
{
if (is_int($offset)) {
$local_offset = $offset - self::TIMEZONE_SERVER_OFFSET;
return time() + 3600 * $local_offset;
}
return time();
}
}

$time = new MyTimeZone();
echo date('h:i:s a', $time->timeOffset(-8)); // finds GMT -8

?>

biggest_apple
01-29-2005, 10:12 PM
Forgot to sign in there before posting :P I was also going to suggest that if an offest feature were to be added it might make sense to impliment an offset calculator in the admin like the one found here: http://www.jholman.com/scripts/offset/

Anonymous
01-31-2005, 02:42 AM
Hi,

Based on the code supplied and a couple of changes to the admin page and the database, I've quickly written a modification that supports the time zone issue.

http://www.pixelpost.org/index.php?x=downloads&details=36