diff options
Diffstat (limited to 'lib/l10n.php')
-rw-r--r-- | lib/l10n.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/l10n.php b/lib/l10n.php index 4eb4c323d88..26611537175 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -58,9 +58,9 @@ class OC_L10N{ * Localization */ private $localizations = array( - 'date' => 'd.m.Y', - 'datetime' => 'd.m.Y H:i:s', - 'time' => 'H:i:s'); + 'date' => '%d.%m.%Y', + 'datetime' => '%d.%m.%Y %H:%M:%S', + 'time' => '%H:%M:%S'); /** * get an L10N instance @@ -216,7 +216,10 @@ class OC_L10N{ case 'time': if($data instanceof DateTime) return $data->format($this->localizations[$type]); elseif(is_string($data)) $data = strtotime($data); - return date($this->localizations[$type], $data); + $locales = array(self::findLanguage()); + if (strlen($locales[0]) == 2) $locales[] = $language.'_'.strtoupper($language); + setlocale(LC_TIME, $locales); + return strftime($this->localizations[$type], $data); break; default: return false; |