Brimbox Logo Brimbox Version 2.3.4 Released


Converts a datetime to the user and PHP datetime from the database and server datetime.

Class: bb_main, called as $main

File: bb_main.php (php)


function convert_date($date, $format = "Y-m-d")


$user_date = $main->convert_date($date);

Returns: date converted into local user datetime from database datetime.

Note: method uses constants DB_TIMEZONE and USER_TIMEZONE from bb-config.php file.

Note: PHP datetime is set to USER_TIMEZONE in controller.

Parameter: $date (string, valid php date)
Database date in acceptable format for php (several formats work).

Parameter: $format(string, php date format)
Standard php date format. See

Updated: 2016-06-16