current date-time in php

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

i want to store the date and time when the user registered i.e. the
record is entered in my table.

so how can i achieve this????

should i use php or mysql to achieve this??

which is more proper and how can i get date-time ???


Re: current date-time in php

Both ways are proper, you could use as a php
function, and insert that into the DB, or use the handy mySQL
TIMESTAMP which automatically picks the current date/time when a record
is created...

Re: current date-time in php

AFAIK, the MySQL timestamp values are also automatically updated when
the database row is modified, which doesn't seem to be what the OP
asked for.  I would use a DATETIME field, and the MySQL function NOW().


Re: current date-time in php

vishal wrote:
Quoted text here. Click to load it

perhaps date("U")?


Site Timeline