@@ 547-560 (lines=14) @@ | ||
544 | * not logged in) default language will be used (see {@link LANG_DEFAULT}). |
|
545 | * @return string String with date. |
|
546 | */ |
|
547 | function get_date ($timestamp, $lang = NULL) |
|
548 | { |
|
549 | global $locale_info; |
|
550 | ||
551 | if (is_null($lang)) |
|
552 | { |
|
553 | $lang = (isset($_SESSION[VAR_LOCALE]) ? $_SESSION[VAR_LOCALE] : LANG_DEFAULT); |
|
554 | } |
|
555 | ||
556 | $format = $locale_info[$lang][LOCALE_DATE_FORMAT]; |
|
557 | $offset = $_SESSION[VAR_TIMEZONE] - intval(date('Z')); |
|
558 | ||
559 | return date($format, $timestamp + $offset); |
|
560 | } |
|
561 | ||
562 | /** |
|
563 | * Returns string with time, formatted according to specified language. |
|
@@ 570-583 (lines=14) @@ | ||
567 | * not logged in) default language will be used (see {@link LANG_DEFAULT}). |
|
568 | * @return string String with time. |
|
569 | */ |
|
570 | function get_time ($timestamp, $lang = NULL) |
|
571 | { |
|
572 | global $locale_info; |
|
573 | ||
574 | if (is_null($lang)) |
|
575 | { |
|
576 | $lang = (isset($_SESSION[VAR_LOCALE]) ? $_SESSION[VAR_LOCALE] : LANG_DEFAULT); |
|
577 | } |
|
578 | ||
579 | $format = $locale_info[$lang][LOCALE_TIME_FORMAT]; |
|
580 | $offset = $_SESSION[VAR_TIMEZONE] - intval(date('Z')); |
|
581 | ||
582 | return date($format, $timestamp + $offset); |
|
583 | } |
|
584 | ||
585 | /** |
|
586 | * Returns string with date and time, formatted according to specified language. |