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


PHP Time::time方法代码示例

本文整理汇总了PHP中Time::time方法的典型用法代码示例。如果您正苦于以下问题:PHP Time::time方法的具体用法?PHP Time::time怎么用?PHP Time::time使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Time的用法示例。


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

示例1: sqlTime

 public static function sqlTime($timestamp = null)
 {
     if ($timestamp !== null && !is_numeric($timestamp)) {
         $timestamp = Time::time($timestamp);
     }
     return $timestamp ? date('H:i:s', $timestamp) : date('H:i:s');
 }
开发者ID:dubhunter,项目名称:talon,代码行数:7,代码来源:Date.php

示例2: time

/**
 * To return the time either artificial or correct.
 * @param boolean $realTime
 * @return int
 */
function time($mode = "CURR", $givenTime = 0)
{
    if (strtoupper($mode) == "CURR") {
        //If mode is "CURR", return the correct user specified time.
        return Time::time();
    } elseif (strtoupper($mode) == "SET") {
        //If mode is "SET", set the current time as specified by user.
        return Time::setTime($givenTime);
    } elseif (strtoupper($mode) == "RESET") {
        //If mode is "RESET", reset the time to the correct system time.
        return Time::resetTime();
    } elseif (strtoupper($mode) == "MOV") {
        //If mode is "MOV", move the clock backward to the difference in time specified by the user. E.g. to move time backward 10 seconds, you will write phpsec\time("MOV", 10);
        return Time::moveTime($givenTime);
    } elseif (strtoupper($mode) == "SYS") {
        //If mode is "SYS", return the correct system time.
        return \time();
    } else {
        return 0;
    }
    //If none of the mode matches, return 0.
}
开发者ID:sachintaware,项目名称:phpsec,代码行数:27,代码来源:time.php

示例3: set

 public static function set($time)
 {
     self::$time = $time;
 }
开发者ID:ttsuruoka,项目名称:php-time,代码行数:4,代码来源:Time.php

示例4: generate

 public function generate($time = null)
 {
     return $this->prefix . date('Ymd:Hi:', $time ?: Time::time()) . uniqid(getmypid(), true);
 }
开发者ID:phresque,项目名称:phresque,代码行数:4,代码来源:IdGenerator.php


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