php-windows Digest 19 Oct 2007 21:18:12 -0000 Issue 3355
Topics (messages 28575 through 28576):
Re: time function
28575 by: Warren Vail
Where Is pprofp.php?
28576 by: D Sledge
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Since PHP only runs on the server it only has direct access to the server
time.
The big integer number that you retrieve with the time function is the
number of seconds since unix epoche
http://www.php.net/manual/en/function.time.php which was Jan 1 1970 00:00:00
GMT.
Use the date function to convert that large number to something you can
read. http://www.php.net/manual/en/function.date.php. A convenient way of
doing this is;
$timestampstring = date("Y-m-d H:i:s",time()); or
$timestampstring = date("Y-m-d H:i:s");
Note that you really don't need to code the current "time" function since
the date function will default to the current time in the absense of a
second variable being passed to the date function, I show it here to make it
clear that the "big number" is a unix binary representation of the current
time, and you can also use the date function to convert these large numbers
to a format that you read, even those large numbers that are stored in a
data base in the "time" binary form.
To get the time on the client machine you will need to use Javascript to
place the visitors current time in a hidden variable in a form and submit
that along with any other data to your server. Google can help you find
lots of scripts to do this, or you can just go to http://www.hotscripts.com
and find one there.
Hope this helps,
Warren Vail
-----Original Message-----
From: Nishantha Pradeep [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 18, 2007 10:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] time function
I want to insert the loging time for a system and i used php "time()"
function but it returns some big number.What is that big number and how I
retrieve the current server or client time using php.
--- End Message ---
--- Begin Message ---
php v5.2.4
Apache 2.2
Windows XP
I've installed the Advanced PHP debugger (APD), but I don't know where
the pprofp script was installed. In relation to my PHP install dir,
where is it supposed to be, and where can I get it if it's not there?
Thanks,
D
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--- End Message ---