Fix so microseconds macro (u) in log_date_format works (#1490446)
| | |
| | | - Plugin API: Added message_ready hook |
| | | - Plugin API: Add special onload() method to execute plugin actions before startup (session and GUI initialization) |
| | | - Implemented UI element to jump to specified page of the messages list (#1485235) |
| | | - Fix so microseconds macro (u) in log_date_format works (#1490446) |
| | | - Fix so unrecognized TNEF attachments are displayed on the list of attachments (#1490351) |
| | | - Fix "Importing..." message does not hide on error (#1490422) |
| | | - Fix Compose action in addressbook for results from multiple addressbooks (#1490413) |
| | |
| | | $session_key = intval(self::$instance->config->get('log_session_id', 8)); |
| | | } |
| | | |
| | | if (empty($date_format)) { |
| | | $date_format = 'd-M-Y H:i:s O'; |
| | | } |
| | | |
| | | $date = date($date_format); |
| | | $date = rcube_utils::date_format($date_format); |
| | | |
| | | // trigger logging hook |
| | | if (is_object(self::$instance) && is_object(self::$instance->plugins)) { |
| | |
| | | |
| | | return $random; |
| | | } |
| | | |
| | | /** |
| | | * Format current date according to specified format. |
| | | * This method supports microseconds (u). |
| | | * |
| | | * @param string $format Date format (default: 'd-M-Y H:i:s O') |
| | | * |
| | | * @return string Formatted date |
| | | */ |
| | | public static function date_format($format = null) |
| | | { |
| | | if (empty($format)) { |
| | | $format = 'd-M-Y H:i:s O'; |
| | | } |
| | | |
| | | if (strpos($format, 'u') !== false |
| | | && ($date = date_create_from_format('U.u.e', microtime(true) . '.' . date_default_timezone_get())) |
| | | ) { |
| | | return $date->format($format); |
| | | } |
| | | |
| | | return date($format); |
| | | } |
| | | } |