Example #1
0
/**
 * @since 3.2.8 time functions adjusted
 */
function qtranxf_format_date($format, $mysq_time, $default, $before = '', $after = '')
{
    global $q_config;
    $ts = mysql2date('U', $mysq_time);
    if ($format == 'U') {
        return $ts;
    }
    $format = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($format);
    if (!empty($format) && $q_config['use_strftime'] == QTX_STRFTIME) {
        $format = qtranxf_convertDateFormatToStrftimeFormat($format);
    }
    return qtranxf_strftime(qtranxf_convertDateFormat($format), $ts, $default, $before, $after);
}
Example #2
0
/**
 * @since 3.4.7 time functions re-organized
 * @since 3.2.8 time functions adjusted
 */
function qtranxf_format_date($format, $mysq_time, $default, $before = '', $after = '')
{
    global $q_config;
    if (empty($format)) {
        return $default;
    }
    $ts = mysql2date('U', $mysq_time);
    //qtranxf_dbg_log('qtranxf_format_date: $format="'.$format.'"; $mysq_time: ', $mysq_time);
    //qtranxf_dbg_log('qtranxf_format_date: $ts: ', $ts);
    if ($format == 'U') {
        return $ts;
    }
    $format = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($format);
    switch ($q_config['use_strftime']) {
        case QTX_STRFTIME_OVERRIDE:
        case QTX_STRFTIME:
            $format = qtranxf_convertDateFormatToStrftimeFormat($format);
            break;
    }
    $format = qtranxf_convertDateFormat($format);
    //qtranxf_dbg_log('qtranxf_format_date: $format: ', $format);
    return qtranxf_strftime($format, $ts, $default, $before, $after);
}