SunQuest
           Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old May 25th, 2005, 09:41 AM
moon moon is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 356 moon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 56 m 39 sec
Reputation Power: 2
Send a message via Yahoo to moon
adjust server date/time

hi there,
i want to display a time in my website according to the time of one of the Arabic countries. and then i want to put a Note(telling ppl that this is according to that country's time)

i was trying to put some calculations for the date in php, but then, that will display the time according to the client time.

So, how can i do that on the server side. let's say, the host site is using linux redhat.
or if iam wrong in my idea to display the date, u can correct me.
thanks.

Reply With Quote
  #2  
Old May 25th, 2005, 05:46 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: adjust server date/time

PHP date/time functions will pull that info from the server it is being called from. Javascript date/time functions will pull from the client. If the server is not in that time zone, just adjust for the offset.

Reply With Quote
  #3  
Old May 26th, 2005, 02:35 AM
moon moon is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 356 moon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 56 m 39 sec
Reputation Power: 2
Send a message via Yahoo to moon
RE: adjust server date/time

Quote:
PHP date/time functions will pull that info from the server it is being called from. Javascript date/time functions will pull from the client. If the server is not in that time zone, just adjust for the offset..


: But why when i adjust my time in the browser the date/time will display it accordingly. Is it because iam using my localhost??

anyway, someone else asked me to use gmdate() then to make some calculations based on it.

i'll try to figure out how to do this, then i'll test on the real production server.
thanks anyway.

Reply With Quote
  #4  
Old August 11th, 2005, 09:12 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: adjust server date/time

Here is an article from NetBulge explaining how to do what you want:
http://www.netbulge.com/index.php?session=0&action=read&click=open&article=1123740309

Reply With Quote
  #5  
Old November 2nd, 2005, 12:34 AM
sleighboy sleighboy is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 49 sleighboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: adjust server date/time

For a quick code bit to do what you want, try this.

php Code:
Original - php Code
  1.  
  2. $gmt_time_zone_offset = "-8";
  3. $target_timestamp = gmmktime() + ($gmt_time_zone_offset * 3600);


Just adjust $gmt_time_zone_offset to the locations offset from GMT, and you are set.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > adjust server date/time


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway