zoukankan      html  css  js  c++  java
  • destoon二次开发-签到时间函数扩展

       在api/extend.func.php文件下增加以下代码:

         

    //签到时间函数
    function timetoday($time = 0, $type = 6) {
    	if(!$time) $time = $GLOBALS['DT_TIME'];
    	$types = array('Y-m-d', 'Y', 'm-d', 'Y-m-d', 'm-d H:i', 'Y-m-d H:i', 'Y-m-d H:i:s' ,'m' ,'d' ,'M','l');
    	//m月份 d日期 M月份英文缩写 l星期缩写
    	if(isset($types[$type])) $type = $types[$type];
    	$date = '';
    	if($time > 2147212800) {		
    		if(class_exists('DateTime')) {
    			$D = new DateTime('@'.($time - 3600 * intval(str_replace('Etc/GMT', '', $GLOBALS['CFG']['timezone']))));
    			$date = $D->format($type);
    		}
    	}
    	return $date ? $date : date($type, $time);
    }
    

      

  • 相关阅读:
    day4
    day3
    day2
    day1
    结对开发
    开课博客
    个人课程总结
    学习进度条-第八周
    学习进度条-第七周
    Fooks 电梯演讲
  • 原文地址:https://www.cnblogs.com/68xi/p/9434994.html
Copyright © 2011-2022 走看看