I have the Date Formats set up in the configuration as: m-d-Y
I've created a new page to show absent members, however the dateformat is not using the mybb settings format on this page specifically.
Current time now shows relative correct date like: 02-18-2018
This page shows it like: 28-2-2018
What have I done wrong?
PHP Code:
$returndate = $users['returndate'];
|
returndate is stored as a string in users table.
PHP Code:
$query = $db->query("
SELECT *
FROM ".TABLE_PREFIX."users
WHERE ".TABLE_PREFIX."users.usergroup IN (4,6,14,17)
ORDER BY username ASC
");
while($users = $db->fetch_array($query)) {
if($users['away'] == '1') {
$users['username'] = format_name($users['username'], $users['usergroup'], $users['displaygroup']);
$users['awaydate'] = my_date($mybb->settings['dateformat'], $users['awaydate']);
$returndate = $users['returndate'];
$awayreason = $users['awayreason'];
eval("\$absentmember .= \"".$templates->get("absentmember_entry")."\";");
}
}
|
I'm really not sure what that means? Where do I go to fix this issue? :/
Which one doesn't work as intended? The
returndate as stated in the first post or the
awaydate?
(02-22-2018 03:49 AM)Niki Wrote: [ -> ]I'm really not sure what that means? Where do I go to fix this issue? :/
returndate is saved as a plain text in users table. It is "formatted" as j-n-Y. You can't use
$mybb->settings['dateformat'] directly into it. You need to convert it to UNIX Timestamp first.
Returndate did not work as it should, awaydate is just fine.
Where do I go to convert this to UNIX Timestamp?