Click to See Complete Forum and Search --> : [RESOLVED] Unix converter


mitchell
02-24-2008, 09:06 AM
hi everyone i have built a user registration system to record NOW() at registration.
i now user $profile[registration_date] and it shows a 10 digit number how can i view the year, month, day, and time. is there something i can change in $profile[registration_date] to view it i the right format or what i can change in the the registration query:
INSERT INTO users (registration_date) VALUES(' NOW() )")
or die(mysql_error());

thanks for any help you give me.

Sheldon
02-24-2008, 06:15 PM
You can use DATE_FORMAT() in your mysql SELECT query to format the date in any way.

Also, your query above will break, you have an extra ' around the NOW().
And why not just use a TIMESTAMP mysql field type?

ss1289
02-24-2008, 06:34 PM
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format

mitchell
02-24-2008, 08:16 PM
thanks