MyBB Community Forums

Full Version: Date format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is the date format used in 'regdate' user database. How can i format my $today date("Y-m-d H:i:s"); ?
AdminCP -> Configuration -> Date and Time Formats

from there you can edit how the time and date is displayed.
For example, I am inserting a new member in the forum. How can I format the date to its format like "1418678052"?

Sample code here:

$regdate = date("Y-m-d H:i:s");
$sql = "INSERT INTO mybb_users (uid, username, password, salt, loginkey, email, usergroup, regdate) VALUES (NULL, \"$myUsername\", \"$myPassword\", \"$salt\", \"$loginkey\",\"$email\", \"$usergroup\", \"$regdate\")";
basically you have to use unix time stamp for the date & time
(04-01-2016, 06:57 AM).m. Wrote: [ -> ]basically you have to use unix time stamp for the date & time

oh, Thank you!