Changeset View
Changeset View
Standalone View
Standalone View
src/view/viewutils.php
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | function phabricator_format_local_time($epoch, $user, $format) { | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
// NOTE: DateTime throws an empty exception if the format is invalid, | // NOTE: DateTime throws an empty exception if the format is invalid, | ||||
// just replace it with a useful one. | // just replace it with a useful one. | ||||
throw new Exception( | throw new Exception( | ||||
pht("Construction of a DateTime() with epoch '%s' ". | pht("Construction of a DateTime() with epoch '%s' ". | ||||
"raised an exception.", $epoch)); | "raised an exception.", $epoch)); | ||||
} | } | ||||
$date->setTimeZone($zone); | $date->setTimezone($zone); | ||||
return PhutilTranslator::getInstance()->translateDate($format, $date); | return PhutilTranslator::getInstance()->translateDate($format, $date); | ||||
} | } |