Chora::formatDate PHP Méthode

formatDate() public static méthode

Return formatted date information.
public static formatDate ( integer $date ) : string
$date integer Number of seconds since epoch we wish to display.
Résultat string The date formatted pursuant to Horde prefs.
    public static function formatDate($date)
    {
        if (!isset(self::$fdcache)) {
            self::$fdcache = $GLOBALS['prefs']->getValue('date_format') . ($GLOBALS['prefs']->getValue('twenty_four') ? ' %H:%M' : ' %I:%M %p');
        }
        return strftime(self::$fdcache, $date);
    }

Usage Example

Exemple #1
0
try {
    $fl = $VC->getFile($where);
} catch (Horde_Vcs_Exception $e) {
    Chora::fatal($e);
}
/* Retrieve the desired revision from the GET variable. */
$rev = Horde_Util::getFormData('rev');
if (!$rev) {
    Chora::fatal(_("No revision specified"));
}
switch (Horde_Util::getFormData('actionID')) {
    case 'log':
        $VC->assertValidRevision($rev);
        $log = $fl->getLog($rev);
        if (!is_null($log)) {
            echo '<em>' . _("Author") . ':</em> ' . Chora::showAuthorName($log->getAuthor(), true) . '<br />' . '<em>' . _("Date") . ':</em> ' . Chora::formatDate($log->getDate()) . '<br /><br />' . Chora::formatLogMessage($log->getMessage());
        }
        exit;
}
if (!$VC->isValidRevision($rev)) {
    Chora::fatal(sprintf(_("Revision %s not found"), $rev), '404 Not Found');
}
try {
    $lines = $VC->annotate($fl, $rev);
} catch (Horde_Vcs_Exception $e) {
    Chora::fatal($e);
}
$title = sprintf(_("Source Annotation (revision %s) for:"), $rev);
$page_output->addScriptFile('annotate.js');
$page_output->addInlineJsVars(array('var Chora' => array('ANNOTATE_URL' => (string) Horde::url('annotate.php', true)->add(array('actionID' => 'log', 'rt' => $sourceroot, 'f' => $where, 'rev' => '')), 'loading_text' => _("Loading..."))));
Chora::header($title);
All Usage Examples Of Chora::formatDate