Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > SUPPORT / INFORMATION > Pixelpost Help

Post Reply
 
Thread Tools
  #1  
Old 01-19-2005, 06:10 AM
Seuss Offline
forum loafer
 
Join Date: Dec 2004
Posts: 11
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
Reply With Quote
  #2  
Old 01-29-2005, 05:42 PM
Connie
Guest
 
Posts: n/a
as it was mentioned in another posting, this is a whish and for sure it is on the whishlist!
Reply With Quote
  #3  
Old 01-29-2005, 10:04 PM
Anonymous Offline
pixelpost guru
 
Join Date: Oct 2004
Posts: 810
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

?>
Reply With Quote
  #4  
Old 01-29-2005, 10:12 PM
biggest_apple Offline
pp regular
 
Join Date: Oct 2004
Posts: 32
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/
Reply With Quote
  #5  
Old 01-31-2005, 02:42 AM
Anonymous Offline
pixelpost guru
 
Join Date: Oct 2004
Posts: 810
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
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 01:58 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs