match time of server computer with local computer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kanchan
Forum Commoner
Posts: 80
Joined: Tue Nov 30, 2004 12:03 pm

match time of server computer with local computer

Post by kanchan »

do you guys know how to match time of server computer with local computer.. my server time is about 7:35 less than my local time ... so how can i manage it?? can you provide me the code??
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post by impulse() »

Is it not possible you can correct the time on the server and then install a time server on the server and synchronize your local computer with the server?

I don't think PHP could handle this.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

If they are Linux OS, you can use this:

Code: Select all

netdate time.nrc.ca
hwclock --systohc
You can put it in crontab ...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Take a look at putenv() in relation to time()/date().
kanchan
Forum Commoner
Posts: 80
Joined: Tue Nov 30, 2004 12:03 pm

Post by kanchan »

Can't we trap the server time first and then and add the time difference in that code?? Please post me the code..... :(
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

kanchan wrote:Can't we trap the server time first and then and add the time difference in that code?? Please post me the code..... :(
Thats thing about these forums, we are here to help you learn, not do stuff for you.

Post some of YOUR code of you attempting this, then you will get some feedback and such.
Post Reply