当前位置: 首页>>代码示例>>PHP>>正文


PHP adodb_gmdate函数代码示例

本文整理汇总了PHP中adodb_gmdate函数的典型用法代码示例。如果您正苦于以下问题:PHP adodb_gmdate函数的具体用法?PHP adodb_gmdate怎么用?PHP adodb_gmdate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了adodb_gmdate函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: UserTimeStamp

 /**
  *
  * @param v  	is the character timestamp in YYYY-MM-DD hh:mm:ss format
  * @param fmt 	is the format to apply to it, using date()
  *
  * @return a timestamp formated as user desires
  */
 function UserTimeStamp($v, $fmt = 'Y-m-d H:i:s', $gmt = false)
 {
     if (!isset($v)) {
         return $this->emptyTimeStamp;
     }
     # strlen(14) allows YYYYMMDDHHMMSS format
     if (is_numeric($v) && strlen($v) < 14) {
         return $gmt ? adodb_gmdate($fmt, $v) : adodb_date($fmt, $v);
     }
     $tt = $this->UnixTimeStamp($v);
     // $tt == -1 if pre TIMESTAMP_FIRST_YEAR
     if (($tt === false || $tt == -1) && $v != false) {
         return $v;
     }
     if ($tt == 0) {
         return $this->emptyTimeStamp;
     }
     return $gmt ? adodb_gmdate($fmt, $tt) : adodb_date($fmt, $tt);
 }
开发者ID:dasatti,项目名称:dashboard,代码行数:26,代码来源:adodb.inc.php

示例2: mkActiveGMDate

 function mkActiveGMDate($param, $acttime = false)
 {
     if (!$acttime) {
         $acttime = time();
     }
     if (function_exists("adodb_gmdate")) {
         return adodb_gmdate($param, $acttime);
     } else {
         return gmdate($param, $acttime);
     }
 }
开发者ID:rchicoria,项目名称:epp-drs,代码行数:11,代码来源:class.activecalendar.php

示例3: wpcf_fields_date_get_calendar

/**
 * Calendar view.
 *
 * @global object $wpdb
 * @global type $m
 * @global type $wp_locale
 * @global type $actors
 * @param type $params
 * @param type $initial
 * @param type $echo
 * @return type
 */
function wpcf_fields_date_get_calendar($params, $initial = true, $echo = true)
{
    global $wpdb, $m, $wp_locale, $actors;
    // wpcf Set our own date
    $monthnum = adodb_date('n', $params['field_value']);
    $year = adodb_date('Y', $params['field_value']);
    $wpcf_date = adodb_date('j', $params['field_value']);
    $cache = array();
    $key = md5($params['field']['slug'] . $wpcf_date);
    if ($cache = wp_cache_get('get_calendar', 'calendar')) {
        if (is_array($cache) && isset($cache[$key])) {
            if ($echo) {
                echo apply_filters('get_calendar', $cache[$key]);
                return;
            } else {
                return apply_filters('get_calendar', $cache[$key]);
            }
        }
    }
    if (!is_array($cache)) {
        $cache = array();
    }
    if (isset($_GET['w'])) {
        $w = '' . intval($_GET['w']);
    }
    // week_begins = 0 stands for Sunday
    $week_begins = intval(get_option('start_of_week'));
    // Let's figure out when we are
    if (!empty($monthnum) && !empty($year)) {
        $thismonth = '' . zeroise(intval($monthnum), 2);
        $thisyear = '' . intval($year);
    } elseif (!empty($w)) {
        // We need to get the month from MySQL
        $thisyear = '' . intval(substr($m, 0, 4));
        $d = ($w - 1) * 7 + 6;
        //it seems MySQL's weeks disagree with PHP's
        $thismonth = $wpdb->get_var($wpdb->prepare("SELECT DATE_FORMAT((DATE_ADD(%s, INTERVAL %d DAY) ), '%%m')", sprintf('%d0101', $thisyear), $d));
    } elseif (!empty($m)) {
        $thisyear = '' . intval(substr($m, 0, 4));
        if (strlen($m) < 6) {
            $thismonth = '01';
        } else {
            $thismonth = '' . zeroise(intval(substr($m, 4, 2)), 2);
        }
    } else {
        $thisyear = adodb_gmdate('Y', current_time('timestamp'));
        $thismonth = adodb_gmdate('m', current_time('timestamp'));
    }
    $unixmonth = adodb_mktime(0, 0, 0, $thismonth, 1, $thisyear);
    $last_day = adodb_date('t', $unixmonth);
    $class = !empty($params['class']) ? ' class="' . $params['class'] . '"' : '';
    /* translators: Calendar caption: 1: month name, 2: 4-digit year */
    $calendar_caption = _x('%1$s %2$s', 'calendar caption');
    $calendar_output = '<table id="wp-calendar-' . md5(serialize(func_get_args())) . '" summary="' . esc_attr__('Calendar') . '"' . $class . '>
	<caption>' . sprintf($calendar_caption, $wp_locale->get_month($thismonth), adodb_date('Y', $unixmonth)) . '</caption>
	<thead>
	<tr>';
    $myweek = array();
    for ($wdcount = 0; $wdcount <= 6; $wdcount++) {
        $myweek[] = $wp_locale->get_weekday(($wdcount + $week_begins) % 7);
    }
    foreach ($myweek as $wd) {
        $day_name = true == $initial ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd);
        $wd = esc_attr($wd);
        $calendar_output .= "\n\t\t<th scope=\"col\" title=\"{$wd}\">{$day_name}</th>";
    }
    $calendar_output .= '
	</tr>
	</thead>

	<tfoot>
	<tr>';
    $calendar_output .= '
	</tr>
	</tfoot>

	<tbody>
	<tr>';
    // See how much we should pad in the beginning
    $pad = calendar_week_mod(adodb_date('w', $unixmonth) - $week_begins);
    if (0 != $pad) {
        $calendar_output .= "\n\t\t" . '<td colspan="' . esc_attr($pad) . '" class="pad">&nbsp;</td>';
    }
    $daysinmonth = intval(adodb_date('t', $unixmonth));
    for ($day = 1; $day <= $daysinmonth; ++$day) {
        if (isset($newrow) && $newrow) {
            $calendar_output .= "\n\t</tr>\n\t<tr>\n\t\t";
        }
//.........这里部分代码省略.........
开发者ID:andxbes,项目名称:firstwpSite1,代码行数:101,代码来源:calendar.php

示例4: wpcf_conditional_add_date_controls

/**
 * Date select form for Group edit screen.
 *
 * @global type $wp_locale
 * @param type $function
 * @param type $value
 * @param type $name
 * @return string
 *
 */
function wpcf_conditional_add_date_controls($function, $value, $name)
{
    global $wp_locale;
    if ($function == 'date') {
        $date_parts = explode(',', $value);
        $time_adj = adodb_mktime(0, 0, 0, $date_parts[1], $date_parts[0], $date_parts[2]);
    } else {
        $time_adj = current_time('timestamp');
    }
    $jj = adodb_gmdate('d', $time_adj);
    $mm = adodb_gmdate('m', $time_adj);
    $aa = adodb_gmdate('Y', $time_adj);
    $output = '<div class="wpcf-custom-field-date">' . "\n";
    $month = "<select name=\"" . $name . '[month]' . "\" >\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        $monthnum = zeroise($i, 2);
        $month .= "\t\t\t" . '<option value="' . $monthnum . '"';
        if ($i == $mm) {
            $month .= ' selected="selected"';
        }
        $month .= '>' . $monthnum . '-' . $wp_locale->get_month_abbrev($wp_locale->get_month($i)) . "</option>\n";
    }
    $month .= '</select>';
    $day = '<input name="' . $name . '[date]" type="text" value="' . $jj . '" size="2" maxlength="2" autocomplete="off" />';
    $year = '<input name="' . $name . '[year]" type="text" value="' . $aa . '" size="4" maxlength="4" autocomplete="off" />';
    $output .= sprintf(__('%1$s%2$s, %3$s'), $month, $day, $year);
    $output .= '<div class="wpcf_custom_field_invalid_date wpcf-form-error"><p>' . __('Please enter a valid date here', 'wpcf') . '</p></div>' . "\n";
    $output .= "</div>\n";
    return $output;
}
开发者ID:CrankMaster336,项目名称:FFW-TR,代码行数:40,代码来源:conditional-display.php

示例5: carl_gmdate

/**
 * Alias for adodb_gmdate()
 */
function carl_gmdate($format, $timestamp = false)
{
    return adodb_gmdate($format, $timestamp);
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:date_funcs.php


注:本文中的adodb_gmdate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。