Example #1
0
function qtrans_timeFromCommentForCurrentLanguage($old_date, $format = '', $gmt = false)
{
    global $comment;
    $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
    return qtrans_strftime(qtrans_convertTimeFormat($format), mysql2date('U', $comment_date), $old_date);
}
Example #2
0
function qtrans_timeFromCommentForCurrentLanguage($old_date, $format = '', $gmt = false, $translate = true)
{
    if (!$translate) {
        return $old_date;
    }
    global $comment, $q_config;
    $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
    $ts = mysql2date('U', $comment_date);
    if ($format == 'U') {
        return $ts;
    }
    $format = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($format);
    if (!empty($format) && $q_config['use_strftime'] == QT_STRFTIME) {
        $format = qtrans_convertDateFormatToStrftimeFormat($format);
    }
    return qtrans_strftime(qtrans_convertTimeFormat($format), $ts, $old_date);
}