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


PHP gmDate函数代码示例

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


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

示例1: _out

function _out($str)
{
    @header('Expires: ' . @gmDate('D, d M Y h:i:s', time() + 30) . ' GMT');
    @header('Content-Length: ' . strLen($str));
    echo $str;
    exit;
}
开发者ID:rkania,项目名称:GS3,代码行数:7,代码来源:host-by-extension.php

示例2: updateAndReturnLatestCommits

 private function updateAndReturnLatestCommits()
 {
     if ($lastSavedCommit = Commit::orderBy('when', 'desc')->first()) {
         $url = "https://api.github.com/repos/nodejs/node/commits?per_page=25&since=" . gmDate("Y-m-d\\TH:i:s\\Z", strtotime($lastSavedCommit->created_at));
     } else {
         $url = "https://api.github.com/repos/nodejs/node/commits?per_page=25";
     }
     $curl = curl_init();
     curl_setopt($curl, CURLOPT_URL, $url);
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($curl, CURLOPT_HEADER, false);
     curl_setopt($curl, CURLOPT_USERAGENT, 'Picmonic PHP Test');
     $data = curl_exec($curl);
     $data = json_decode($data);
     curl_close($curl);
     foreach ($data as $commitData) {
         $commit = new Commit();
         $commit->sha = $commitData->sha;
         $commit->name = $commitData->commit->author->name;
         $commit->message = $commitData->commit->message;
         $commit->when = $commitData->commit->committer->date;
         $commit->url = $commitData->commit->url;
         $commit->save();
     }
     return Commit::orderBy('when', 'desc')->take(25)->get();
 }
开发者ID:jaimemasson,项目名称:example-php-challenge,代码行数:26,代码来源:HomeController.php

示例3: JPGText

function JPGText($str, $fontname, $fontsize, $backcol, $txtcol)
{
    global $layout;
    Header("Last-Modified: " . gmDate("D, d M Y H:i:s", Time()) . " GMT");
    Header("Expires: " . gmDate("D, d M Y H:i:s", Time() - 3601) . " GMT");
    Header("Pragma: no-cache");
    Header("Cache-control: no-cache");
    Header("Content-Type: image/jpeg");
    $a = ImageTTFBBox($fontsize, 0, $fontname, $str);
    $width = $a[2] + 4;
    $bla = get_maximum_height($fontname, $fontsize);
    $height = $bla[0] + 3;
    $bl = $bla[1];
    $im = ImageCreate($width, $height);
    $bgcol = ImageColorAllocate($im, $backcol['red'], $backcol['green'], $backcol['blue']);
    $fgcol = ImageColorAllocate($im, $txtcol['red'], $txtcol['green'], $txtcol['blue']);
    if (!function_exists(imagegif)) {
        imageTTFText($im, $fontsize, 0, 2, $bl + $fontsize / 6 + 2, $fgcol, $fontname, $str);
        imagejpeg($im, "", 80);
    } else {
        ImageColorTransparent($im, $bgcol);
        imageTTFText($im, $fontsize, 0, 2, $bl + $fontsize / 6 + 2, $fgcol, $fontname, $str);
        imagegif($im);
    }
    ImageDestroy($im);
}
开发者ID:netzhuffle,项目名称:mainchat,代码行数:26,代码来源:userinfo.php

示例4: checkdomainclaim

/**
 * @param Metaregistrar\EPP\eppConnection $conn
 * @param string $domainname
 * @return array|null
 */
function checkdomainclaim($conn, $domainname)
{
    $check = new Metaregistrar\EPP\eppLaunchCheckRequest(array($domainname));
    $check->setLaunchPhase(Metaregistrar\EPP\eppLaunchCheckRequest::PHASE_CLAIMS, null, Metaregistrar\EPP\eppLaunchCheckRequest::TYPE_CLAIMS);
    if (($response = $conn->writeandread($check)) instanceof Metaregistrar\EPP\eppLaunchCheckResponse && $response->Success()) {
        //$phase = $response->getLaunchPhase();
        /* @var Metaregistrar\EPP\eppLaunchCheckResponse $response */
        $checks = $response->getDomainClaims();
        foreach ($checks as $check) {
            echo $check['domainname'] . " has " . ($check['claimed'] ? 'a claim' : 'no claim') . "\n";
            if ($check['claimed']) {
                if ($check['claim']) {
                    if ($check['claim'] instanceof Metaregistrar\EPP\eppDomainClaim) {
                        echo "Claim validator: " . $check['claim']->getValidator() . ", claim key: " . $check['claim']->getClaimKey() . "\n";
                        $tmch = new Metaregistrar\TMCH\cnisTmchConnection(true, 'settingslive.ini');
                        $claim = array();
                        $output = $tmch->getCnis($check['claim']->getClaimKey());
                        /* @var $output Metaregistrar\TMCH\tmchClaimData */
                        $claim['noticeid'] = $output->getNoticeId();
                        $claim['notafter'] = $output->getNotAfter();
                        $claim['confirmed'] = gmDate("Y-m-d\\TH:i:s\\Z");
                        return $claim;
                    } else {
                        throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no valid claim key is present");
                    }
                } else {
                    throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no claim key is present");
                }
            }
        }
    } else {
        echo "ERROR2\n";
    }
    return null;
}
开发者ID:pkaz,项目名称:php-epp-client,代码行数:40,代码来源:createclaimeddomain.php

示例5: get_current_date

function get_current_date()
{
    global $current_date;
    if (isset($current_date)) {
        return $current_date;
    }
    $current_date = gmDate("Y-m-d\\TH:i:s\\Z");
    return $current_date;
}
开发者ID:jesusvaz,项目名称:ims-dev,代码行数:9,代码来源:cert_util.php

示例6: writelog

function writelog($pane)
{
    $path = dirname(__FILE__) . "/bin/logs";
    $getdate = gmDate("Ymd");
    $tmux = new Tmux();
    $logs = $tmux->get()->write_logs;
    if ($logs == 1) {
        return "2>&1 | tee -a {$path}/{$pane}-{$getdate}.log";
    } else {
        return "";
    }
}
开发者ID:RickDB,项目名称:newznab-tmux,代码行数:12,代码来源:run.php

示例7: get_clicks_for_today

function get_clicks_for_today($BID, $user_id = 0)
{
    $date = gmDate(Y) . "-" . gmDate(m) . "-" . gmDate(d);
    $sql = "SELECT *, SUM(clicks) AS clk FROM `clicks` where banner_id='{$BID}' AND `date`='{$date}' GROUP BY banner_id";
    $result = mysql_query($sql) or die(mysql_error());
    $row = mysql_fetch_array($result);
    return $row['clk'];
}
开发者ID:mix376,项目名称:MillionDollarScript,代码行数:8,代码来源:functions.php

示例8: getDateTime

 public static function getDateTime()
 {
     return gmDate('Y-m-d H:i:s');
 }
开发者ID:EbrahemS,项目名称:SRCMS,代码行数:4,代码来源:misc.class.php

示例9: ini_set

if (isset($_POST['submit'])) {
    ini_set('magic_quotes_gpc', false);
    // magic quotes will only confuse things like escaping apostrophe
    //SiteID must also be set in the Request's XML
    //SiteID = 0  (US) - UK = 3, Canada = 2, Australia = 15, ....
    //SiteID Indicates the eBay site to associate the call with
    $siteID = 0;
    //the call being made:
    $verb = 'GetSellerEvents';
    $detailLevel = 'ReturnAll';
    $errorLanguage = 'en_US';
    $site = "US";
    $currency = "USD";
    $country = "US";
    $modTimeTo = gmDate("Y-m-d\\TH:i:s\\Z");
    $modTimeFrom = gmDate("Y-m-d\\TH:i:s\\Z", time() - 3 * 24 * 60 * 60);
    ///Build the request Xml string
    $requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>';
    $requestXmlBody .= '<GetSellerEventsRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
    $requestXmlBody .= "<RequesterCredentials><eBayAuthToken>{$userToken}</eBayAuthToken></RequesterCredentials>";
    $requestXmlBody .= "<DetailLevel>{$detailLevel}</DetailLevel>";
    $requestXmlBody .= "<ErrorLanguage>{$errorLanguage}</ErrorLanguage>";
    $requestXmlBody .= "<Version>{$compatabilityLevel}</Version>";
    $requestXmlBody .= "<ModTimeFrom>{$modTimeFrom}</ModTimeFrom>";
    $requestXmlBody .= "<ModTimeTo>{$modTimeTo}</ModTimeTo>";
    $requestXmlBody .= '</GetSellerEventsRequest>';
    //Create a new eBay session with all details pulled in from included keys.php
    $session = new eBaySession($userToken, $devID, $appID, $certID, $serverUrl, $compatabilityLevel, $siteID, $verb);
    //send the request and get response
    $responseXml = $session->sendHttpRequest($requestXmlBody);
    if (stristr($responseXml, 'HTTP 404') || $responseXml == '') {
开发者ID:aditya161742,项目名称:phpebay,代码行数:31,代码来源:GetSellerEvents.php

示例10: set_var

set_var("v_b_fecha_desde", $fecha_desde);
// fecha_desde
set_var("v_b_fecha_hasta", $fecha_hasta);
// fecha_hasta
set_var("v_b_nro_orden", $b_nro_orden);
set_var("v_b_dni_remitente", $b_dni_remitente);
set_var("v_b_dni_destinatario", $b_destinatario);
set_var("v_sucursal", $_SESSION['sucursal']);
// fecha_hasta
set_var("v_total_ctacte", 0.0);
// sumatoria de cta cte
set_var("v_sucursal", $_SESSION['sucursal']);
// sumatoria de cta cte
set_var("v_vendedor", $_SESSION['usuario']);
// fecha de impresion
set_var("v_fecha", gmDate(" d/m/Y - H:i"));
$db = conectar_al_servidor();
// Indica la cantidad de registros encontrados.
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
//                       MUESTRA TODOS LOS REGISTROS DE LAS ENCOMIENDAS sin procesar
//----------------------------------------------------------------------------------------------------
$sql = "select  DISTINCT\n                e.NRO_GUIA,\n\t\te.FECHA,\n\t\te.REMITENTE,\n\t\te.CUIT_ORIGEN,\n\t\te.DIRECCION_REMITENTE,\n\t\te.TEL_ORIGEN,\n\t\te.DESTINATARIO,\n\t\te.CUIT_DESTINO,\n\t\te.DIRECCION_DESTINO,\n\t\te.TEL_DESTINO,\n\t\tde.DESCRIPCION as  tipo_encomienda, /* 10 */\n\t\te.PRIORIDAD,\n\t\te.FECHA_ENTREGA,\n\t\te.PRECIO,\n\t\tc.usuario AS comisionista,\n\t\te.ESTADO,\n\t\te.USUARIO,\n\t\tlr.localidad AS Localidad_remitente,\n\t\tld.localidad AS Localidad_destinatario,\n\t\tCONCAT(f.Nro_SUCURSAL,'-',f.NRO_FACTURA) AS nro_factura,\n                /* indica si estamos en presencia de una encomienda adeudada por pago en destinatario */\n                if( 4 in (select p.forma_pago from pagos p where p.id_encomienda=e.NRO_GUIA), 1,0) AS deuda\n\t\t\n        from encomiendas AS e\n                Inner Join detalle_encomiendas AS de ON (e.NRO_GUIA = de.id_encomienda)and(e.ELIMINADO='N')\n                Inner Join usuarios AS c ON (c.id = de.id_comisionista)\n\t\tInner Join localidades AS lr ON (e.ID_LOCALIDAD_REMITENTE = lr.codigo)\n\t\tInner Join localidades AS ld ON (e.ID_LOCALIDAD_DESTINATARIO = ld.codigo)\n\t\tLeft Join usuarios AS u ON (e.ID_COMISIONISTA = u.id)\n\t\tLeft Join facturas AS f ON (e.ID_FACTURA = f.CODIGO)";
$res = ejecutar_sql($db, $sql . $w);
$v_total = 0;
//----------------------------------------------------------------------------------------------------
// Verificamos el resultado de la busqueda.
//----------------------------------------------------------------------------------------------------
if (!$res) {
    echo $db->ErrorMsg();
    die;
开发者ID:scintes,项目名称:sistemas,代码行数:31,代码来源:imprimir_cierre_encomienda_procesadas.php

示例11: Header

<?php

// Version / Copyright - nicht entfernen!
$mainchat_version = "Open mainChat 5.0.8 (c) by fidion GmbH 1999-2012";
$mainchat_email = "info@fidion.de";
// HTTPS ja oder nein?
// if ($HTTPS=="on") {
//	$httpprotocol="https://";
//} else {
//	$httpprotocol="http://";
//}
// Caching unterdrücken
Header("Last-Modified: " . gmDate("D, d M Y H:i:s", Time()) . " GMT");
Header("Expires: " . gmDate("D, d M Y H:i:s", Time() - 3601) . " GMT");
Header("Pragma: no-cache");
Header("Cache-Control: no-cache");
// Variable initialisieren, einbinden, Community-Funktionen laden
if (!isset($functions_init_geladen)) {
    require_once "functions-init.php";
}
if ($communityfeatures) {
    require_once "functions-community.php";
}
// DB-Connect, ggf. 3 mal versuchen
for ($c = 0; $c++ < 3 and !isset($conn);) {
    if ($conn = @mysql_connect($mysqlhost, $mysqluser, $mysqlpass)) {
        mysql_set_charset("utf8mb4");
        mysql_select_db($dbase, $conn);
    }
}
if (!isset($conn)) {
开发者ID:netzhuffle,项目名称:mainchat,代码行数:31,代码来源:functions.php

示例12: gmDate

            echo '<a href="lmsstatus.php">Refresh</a>' . "\n";
            // echo('<a href="lmsstatus.php?autorefresh=yes">Auto Refresh</a>'."\n");
        }
        echo '<a href="lmsstatus.php?final=yes">Final Report</a>' . "\n";
    }
    echo ' Software=' . $_SESSION['software'] . ' version=' . $_SESSION['version'];
    if ($final) {
        echo "<p>";
    }
    echo ' key=' . $_SESSION['cert_consumer_key'];
    if ($final) {
        echo "<p>Test Date: ";
    } else {
        echo "<br/>\n";
    }
    echo gmDate("Y-m-d\\TH:i:s\\Z");
} else {
    echo "<p>This test is not yet configured.</p>\n";
    exit;
}
load_cert_data();
if ($final) {
    echo '<p>Test URL: ' . $curURL . "</p>\n";
    echo '<table width="70%">';
} else {
    echo '<p>Scroll to the bottom of this page to see the URL, Key, and Secret to use for this test.</p>' . "\n";
    echo '<table>';
}
echo '<tr><th width="15%">Test</th><th width="65%">Description</th><th width="20%">Result</th></tr>' . "\n";
$idno = 100;
$count = 0;
开发者ID:jesusvaz,项目名称:ims-dev,代码行数:31,代码来源:lmsstatus.php

示例13: session_start

<?php

session_start();
include 'config.php';
?>
<!DOCTYPE html>
<html>
	<head>
		<title>Team Assignment</title>
	</head>
	<body>
		<?php 
if (isset($_POST['submit'])) {
    $query = "set search_path=project;\n\t\t\t\tSelect H.firstname, H.lastname, S.showname, P.date\n\t\t\t\tfrom show S, timeslot T, playsheet P, host H, hostsshow HS\n\t\t\t\twhere s.category='" . $_POST['category'] . "' and s.shownumber=t.shownumber and t.playsheetnumber = p.playsheetnum and HS.shownum = s.shownumber \n\t\t\t\t\tand HS.empnum = H.enumb and p.date >= all \n\t\t\t\t\t\t(select p1.date \n\t\t\t\t\t\tfrom show S1, timeslot T1, playsheet P1 \n\t\t\t\t\t\twhere s1.category='" . $_POST['category'] . "' and s1.shownumber=t1.shownumber and t1.playsheetnumber = p1.playsheetnum and\n\t\t\t\t\t\tp1.date<'" . gmDate("Y/m/d") . "') and p.date<'" . gmDate("Y/m/d") . "';";
    $result = pg_query($dbconn, $query);
    if (!$result) {
        die("error in sql query: " . pg_last_error());
    }
    if (pg_num_rows($result) > 0) {
        echo "The last time a show with the \"" . $_POST['category'] . "\" category aired, it was hosted by <br>";
        while ($row = pg_fetch_array($result)) {
            echo " - " . $row[0] . " " . $row[1] . " on the \"" . $row[2] . "\" show, the " . $row[3] . ".<br>";
        }
    } else {
        echo "There are either no hosts for the \"" . $_POST['category'] . "\" category or the show for that category hasn't aired yet.";
    }
    echo '<br><br><a href="query3.php">Perform another seach.</a>';
    pg_free_result($result);
    pg_close($dbconn);
} else {
    ?>
开发者ID:SeanLF,项目名称:uOttawa,代码行数:31,代码来源:query3.php

示例14: gmDate

<?php

//This is the only variable you might need to change.
$dir = "/home/httpd/html/mrtg";
//These variables can be used to change some of the colors
//Colors for the log file tables
$topcol = "bgcolor=#eeeeee";
$namew = "bgcolor=#f4f4f4";
$valw = "bgcolor=#ffffff";
//Background colors for alternate tables
$bigback1 = "bgcolor=#EEFFFF";
$bigback2 = "bgcolor=#F2FFF2";
//Please do not edit any of the code below unless you know what your doing
$version = "V 1.021";
$first = 1;
$extime = gmDate("D") . "," . gmDate("d M Y H:i:s") . "GMT";
?>

<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="300">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="<?php 
echo $extime;
?>
">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<title>Welcome to MRTG-PHP</title>
<style fprolloverstyle>A:hover {color: #33CCFF; text-decoration: underline}
</style>
</head>
开发者ID:oetiker,项目名称:mrtg,代码行数:31,代码来源:mrtg.php

示例15: revoke_cert

function revoke_cert($my_serial, $my_passPhrase)
{
    $config = $_SESSION['config'];
    print "<BR><b>Loading CA key...</b><br/>";
    flush();
    $fp = fopen($config['cakey'], "r") or die('Fatal: Unable to open CA Private Key: ' . $keyfile);
    $myKey = fread($fp, filesize($config['cakey'])) or die('Fatal: Error whilst reading the CA Private Key: ' . $keyfile);
    fclose($fp) or die('Fatal: Unable to close CA Key ');
    print "Done<br/><br/>\n";
    print "<b>Decoding CA key...</b><br/>";
    flush();
    if ($privkey = openssl_pkey_get_private($myKey, $my_passPhrase) or die('Error with passphrase for CA Key.')) {
        print "Done\n<br>Passphrase correct<br/>\n";
    }
    print "Revoking " . $my_serial . "<BR>\n";
    $pattern = '/(\\D)\\t(\\d+[Z])\\t(\\d+[Z])?\\t([a-z0-9]+)\\t(\\D+)\\t(.+)/';
    $my_index_handle = fopen($config['index'], "r") or die('Unable to open Index file for reading');
    while (!feof($my_index_handle)) {
        $this_line = rtrim(fgets($my_index_handle));
        if (preg_match($pattern, $this_line, $matches)) {
            if ($matches[1] == 'V' && $matches[4] == $my_serial) {
                $my_valid_to = $matches[2];
                $my_index_name = $matches[6];
                print "Found " . $my_serial . " " . $my_index_name . "<BR>\n";
            }
        }
    }
    fclose($my_index_handle);
    $orig_index_line = "V\t" . $my_valid_to . "\t\t" . $my_serial . "\tunknown\t" . $my_index_name;
    $new_index_line = "R\t" . $my_valid_to . "\t" . gmDate("ymdHis\\Z") . "\t" . $my_serial . "\tunknown\t" . $my_index_name;
    $my_index = file_get_contents($config['index']) or die('Fatal: Unable to open Index File');
    $my_index = str_replace($orig_index_line, $new_index_line, $my_index) or die('Unable to update Status of Cert in Index string');
    file_put_contents($config['index'], $my_index);
    //openssl ca -revoke $config['cert_path'].$filename -keyfile $config['cakey'] -cert $config['cacert'] -config $config['config']
    //openssl ca -gencrl -keyfile $config['cakey'] -cert $config['cacert'] -out $config['cacrl'] -crldays 365 -config $config['config']
    $cmd = "openssl ca -gencrl -passin pass:" . $my_passPhrase . " -crldays 365" . " -keyfile \"" . $config['cakey'] . "\" -cert \"" . $config['cacert'] . "\" -out \"" . $config['cacrl'] . "\" -config \"" . $config['config'] . "\"";
    exec($cmd, $output_array, $retval);
    if ($retval) {
        print $cmd . "\n<BR>";
        print_r($output_array);
        print "\n<BR>";
        die('Fatal: Error processing GENCRL command');
    } else {
        print "CRL published to " . $config[cacrl] . "\n<br>";
    }
}
开发者ID:NamingException,项目名称:PHP-Certificate-Authority-Server,代码行数:46,代码来源:functions_cert.php


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