Forum Moderators: coopster

Message Too Old, No Replies

getting current date

         

ganie17

1:13 am on Nov 23, 2004 (gmt 0)

10+ Year Member



hello guys...

I just wanna ask on how to get the current date of the system coz i'll be inserting it in my custlogin table. I like to monitor when the user was logged.

I used this syntax:

$date = gmdate(Y-d-M[,timestamp]);

I have read it from the book. can anyone help me?
thanks in advance!

saoi_jp

2:34 am on Nov 23, 2004 (gmt 0)

10+ Year Member



gmdate gives you Greenwich Mean Time.

If you want the time on your server, you don't need the timestamp. Only use a timestamp if your server is not in the same timezone as "local" (for example, you host in California but the site is an event calendar in Miami).

Basically, for local time, use
$date = date("Y-m-d");
for a value such as 2004-11-23.

Alternative formatting exists. For example, use
$date = date("l, F d, Y");
for a value such as Tuesday, November 23, 2004.

See the PHP site for all format charaters:
[php.net...]