two methods:
1. you can either use the time() function within php which will give you the time that the relevant line of the script is called.
2. you can use the $_SERVER['REQUEST_TIME'] superglobal. (only available in php 5.1.0 and above.
the function time() returns the current unix timestamp.
Code:
echo "current time is ". time();
you can insert the timestamp into a database or parse into a human readable form for display (see the php.net section on date and time functions for how to do the latter).
It might be worthwhile pointing out that the IP address is unreliable when used accross the web unless of course your sure that it is valid, for example in a company intranet.
hello
I think u people r not getting my point... by using time or date function i'll get the time of the server.. i want to get the time of the client....that, what is the time of the ISP using by a certain user.
bye
i'd suggest using some javascript to add the time to a form variable or to the url when the link to the next page was clicked. this will not be the time of the client's ISP but the time of the client's computer.
I do not know a way of obtaining the time of the client's ISP.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.