functions.time.php

来自「php 开发的内容管理系统」· PHP 代码 · 共 38 行

PHP
38
字号
<?php
/**
 * Article management
 *
 * @copyright	The XOOPS project http://www.xoops.org/
 * @license		http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author		Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
 * @since		1.00
 * @version		$Id$
 * @package		module::article
 */

if (!defined('XOOPS_ROOT_PATH')){ exit(); }

include dirname(__FILE__)."/vars.php";
define($GLOBALS["artdirname"]."_FUNCTIONS_TIME_LOADED", TRUE);

IF(!defined("ART_FUNCTIONS_TIME")):
define("ART_FUNCTIONS_TIME", 1);

/**
 * Function to convert UNIX time to formatted time string
 */
function art_formatTimestamp($time, $format = "c", $timeoffset = "")
{
	load_functions("locale");
	
	if(strtolower($format) == "reg" || strtolower($format) == "") {
		$format = "c";
	}
	if( (strtolower($format) == "custom" || strtolower($format) == "c") && !empty($GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"]) ) {
		$format = $GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"];
	}
	
	return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
}
ENDIF;
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?