Brimbox Logo Brimbox Version 2.3.4 Released

convert_date>>

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)

Declaration:

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

Usage:

$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 http://php.net/manual/en/function.date.php

Updated: 2016-06-16