當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。