[thelist] web and db server local time

Bob Meetin bobm at dottedi.biz
Fri Nov 16 14:57:01 CST 2007


Joel, 

Not sure about the browser part.  However here is some php code I added 
to display the currentDate or currentTime on a page.  You have to adjust 
the TimeDiff according to the timezone of the hosting service.

-Bob

$TimeDiff = +2+date('');
$TimeZoneEpoc = time() - ($TimeDiff*60*60);
$currentDate = date('F j, Y',$TimeZoneEpoc);
$currentTime = date('g:i A',$TimeZoneEpoc);

Joel D Canfield wrote:
> sanity check: I'm mucking with my homemade blog tool. inserting
> timestamps is putting in a time one hour in the future. I'm in Pacific
> Time; web/db servers are in AZ at Crystal Tech.
>
> I'm a little foggy today, but I certainly don't remember building
> timezone adjustments into web apps before. If I'm using forms in a
> browser to insert/update info, shouldn't the web server be aware of my
> local time via the browser?
>
> yeah, I'm that foggy
>
> joel
>   


-- 
Bob Meetin
dotted i - Internet Strategies & Solutions
www.dottedi.biz
303-926-0167





More information about the thelist mailing list