diff --git a/classes/Format.class.php b/classes/Format.class.php index 65c1d2b..c8c83cd 100644 --- a/classes/Format.class.php +++ b/classes/Format.class.php @@ -21,7 +21,7 @@ class Format /* Date & time */ static protected $time_format = 'H:i:s'; static protected $date_format = 'd.m.Y'; - static protected $date_time_format = 'd.m.Y H:i'; + static protected $date_time_format = 'H:i d.m.Y'; static protected $timezone_offset = 0; static protected $cache_time = array(); @@ -129,6 +129,18 @@ class Format } return self::$cache_time[$time]; } + + static public function int2phone($intphone) + { + $intphone = (string) $intphone; + + if (strlen($intphone) == 10) { + return '('.substr($intphone, 0, 3).') '.substr($intphone, 3, 3).'-'.substr($intphone, 6, 2).'-'.substr($intphone, 8, 2); + } elseif (strlen($intphone) == 7) { + return substr($intphone, 0, 3).'-'.substr($intphone, 3, 2).'-'.substr($intphone, 5, 2); + } + return ''; + } } Format::setTimezoneOffset(date('Z'));