|
#1
|
|||
|
|||
|
Fixing Time Display?
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 |
|
#2
|
|||
|
|||
|
as it was mentioned in another posting, this is a whish and for sure it is on the whishlist!
|
|
#3
|
|||
|
|||
|
I think something like this would be needed:
Code:
<?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
?>
|
|
#4
|
|||
|
|||
|
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/
__________________
http://www.smallestphoto.com/ |
|
#5
|
|||
|
|||
|
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...amp;details=36 |
| Post Reply |
| Thread Tools | |
|
|