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


PHP ADORecordSet::UnixDate方法代码示例

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


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

示例1: DBDate

 function DBDate($d)
 {
     if (is_string($d)) {
         $d = ADORecordSet::UnixDate($d);
     }
     return 'TO_DATE(' . date($this->fmtDate, $d) . ",'YYYY-MM-DD')";
 }
开发者ID:OberjukhtinIA0VWV0Allokuum,项目名称:testmasteke.leo,代码行数:7,代码来源:adodb-oracle.inc.php

示例2: DBDate

	function DBDate($d)
	{
		if (is_string($d)) $d = ADORecordSet::UnixDate($d);
		if (is_object($d)) $ds = $d->format($this->fmtDate);
		else $ds = adodb_date($this->fmtDate,$d);
		return 'TO_DATE('.$ds.",'YYYY-MM-DD')";
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:7,代码来源:adodb-oracle.inc.php

示例3: DBDate

 function DBDate($d)
 {
     if (empty($d) && $d !== 0) {
         return 'null';
     }
     if (is_string($d)) {
         $d = ADORecordSet::UnixDate($d);
     }
     return 'TO_DATE(' . date($this->fmtDate, $d) . ",'YYYY-MM-DD')";
 }
开发者ID:qoire,项目名称:portal,代码行数:10,代码来源:adodb-oci8.inc.php

示例4: DBDate

 function DBDate($d, $isfld = false)
 {
     if (is_string($d)) {
         $d = ADORecordSet::UnixDate($d);
     }
     if (is_object($d)) {
         $ds = $d->format($this->fmtDate);
     } else {
         $ds = adodb_date($this->fmtDate, $d);
     }
     return 'TO_DATE(' . $ds . ",'YYYY-MM-DD')";
 }
开发者ID:fgbreel,项目名称:ADOdb,代码行数:12,代码来源:adodb-oracle.inc.php

示例5: DBDate

	function DBDate($d)
	{
		if (empty($d) && $d !== 0) return 'null';

		if (is_string($d)) $d = ADORecordSet::UnixDate($d);
		return "TO_DATE(".adodb_date($this->fmtDate,$d).",'".$this->dateformat."')";
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:7,代码来源:adodb-oci8.old.inc.php

示例6: DBDate

 function DBDate($d, $isfld = false)
 {
     if (empty($d) && $d !== 0) {
         return 'null';
     }
     if ($isfld) {
         return 'TO_DATE(' . $d . ",'" . $this->dateformat . "')";
     }
     if (is_string($d)) {
         $d = ADORecordSet::UnixDate($d);
     }
     return "TO_DATE(" . adodb_date($this->fmtDate, $d) . ",'" . $this->dateformat . "')";
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:13,代码来源:adodb-oci8.inc.php

示例7: DBDate

 function DBDate($d)
 {
     if (empty($d) && $d !== 0) {
         return 'null';
     }
     if (is_string($d)) {
         $d = ADORecordSet::UnixDate($d);
     }
     return "TO_DATE(" . adodb_date($this->fmtDate, $d) . ",'" . $this->NLS_DATE_FORMAT . "')";
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:10,代码来源:adodb-oci8.inc.php

示例8: testdb

function testdb(&$db, $createtab = "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
{
    global $ADODB_vers, $ADODB_CACHE_DIR, $ADODB_FETCH_MODE, $ADODB_COUNTRECS;
    //adodb_pr($db);
    ?>
	<form method=GET>
	</p>
	<table width=100% ><tr><td bgcolor=beige>&nbsp;</td></tr></table>
	</p>
<?php 
    $create = false;
    /*$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
    	
    	$rs = $db->Execute('select lastname,firstname,lastname,id from ADOXYZ');
    	$arr = $rs->GetAssoc();
    	echo "<pre>";print_r($arr);
    	die();*/
    if (!$db) {
        die("testdb: database not inited");
    }
    global $EXECS, $CACHED;
    $EXECS = 0;
    $CACHED = 0;
    //$db->Execute("drop table adodb_logsql");
    if (rand() % 3 == 0) {
        @$db->Execute("delete from adodb_logsql");
    }
    $db->debug = 1;
    $db->fnExecute = 'CountExecs';
    $db->fnCacheExecute = 'CountCachedExecs';
    if (empty($_GET['nolog'])) {
        echo "<h3>SQL Logging enabled</h3>";
        $db->LogSQL();
        /*
        		$sql =
        "SELECT t1.sid, t1.sid, t1.title, t1.hometext, t1.notes, t1.aid, t1.informant, 
        t2.url, t2.email, t1.catid, t3.title, t1.topic, t4.topicname, t4.topicimage, 
        t4.topictext, t1.score, t1.ratings, t1.counter, t1.comments, t1.acomm 
        FROM `nuke_stories` `t1`, `nuke_authors` `t2`, `nuke_stories_cat` `t3`, `nuke_topics` `t4` 
        	WHERE ((t2.aid=t1.aid) AND (t3.catid=t1.catid) AND (t4.topicid=t1.topic) 
        	AND ((t1.alanguage='german') OR (t1.alanguage='')) AND (t1.ihome='0')) 
        	ORDER BY t1.time DESC";
        		$db->SelectLimit($sql);
        		echo $db->ErrorMsg();*/
    }
    $ADODB_CACHE_DIR = dirname(TempNam('/tmp', 'testadodb'));
    $db->debug = false;
    //print $db->UnixTimeStamp('2003-7-22 23:00:00');
    $phpv = phpversion();
    if (defined('ADODB_EXTENSION')) {
        $ext = ' &nbsp; Extension ' . ADODB_EXTENSION . ' installed';
    } else {
        $ext = '';
    }
    print "<h3>ADODB Version: {$ADODB_vers} Host: <i>{$db->host}</i> &nbsp; Database: <i>{$db->database}</i> &nbsp; PHP: {$phpv} {$ext}</h3>";
    flush();
    if (function_exists('date_default_timezone_set')) {
        date_default_timezone_set('Asia/Kuala_Lumpur');
    }
    $arr = $db->ServerInfo();
    print_r($arr);
    echo E_ALL, ' ', E_STRICT, "<br>";
    $e = error_reporting(E_ALL | E_STRICT);
    echo error_reporting(), '<p>';
    flush();
    #$db->debug=1;
    $tt = $db->Time();
    if ($tt == 0) {
        echo '<br><b>$db->Time failed</b>';
    } else {
        echo "<br>db->Time: " . date('d-m-Y H:i:s', $tt);
    }
    echo '<br>';
    echo "Date=", $db->UserDate('2002-04-07'), '<br>';
    print "<i>date1</i> (1969-02-20) = " . $db->DBDate('1969-2-20');
    print "<br><i>date1</i> (1999-02-20) = " . $db->DBDate('1999-2-20');
    print "<br><i>date1.1</i> 1999 = " . $db->DBDate("'1999'");
    print "<br><i>date2</i> (1970-1-2) = " . $db->DBDate(24 * 3600) . "<p>";
    print "<i>ts1</i> (1999-02-20 13:40:50) = " . $db->DBTimeStamp('1999-2-20 1:40:50 pm');
    print "<br><i>ts1.1</i> (1999-02-20 13:40:00) = " . $db->DBTimeStamp('1999-2-20 13:40');
    print "<br><i>ts2</i> (1999-02-20) = " . $db->DBTimeStamp('1999-2-20');
    print "<br><i>ts3</i> (1970-1-2 +/- timezone) = " . $db->DBTimeStamp(24 * 3600);
    print "<br> Fractional TS (1999-2-20 13:40:50.91): " . $db->DBTimeStamp($db->UnixTimeStamp('1999-2-20 13:40:50.91+1'));
    $dd = $db->UnixDate('1999-02-20');
    print "<br>unixdate</i> 1999-02-20 = " . date('Y-m-d', $dd) . "<p>";
    print "<br><i>ts4</i> =" . ($db->UnixTimeStamp("19700101000101") + 8 * 3600);
    print "<br><i>ts5</i> =" . $db->DBTimeStamp($db->UnixTimeStamp("20040110092123"));
    print "<br><i>ts6</i> =" . $db->UserTimeStamp("20040110092123");
    print "<br><i>ts7</i> =" . $db->DBTimeStamp("20040110092123");
    flush();
    // mssql too slow in failing bad connection
    if (false && $db->databaseType != 'mssql') {
        print "<p>Testing bad connection. Ignore following error msgs:<br>";
        $db2 = ADONewConnection();
        $rez = $db2->Connect("bad connection");
        $err = $db2->ErrorMsg();
        print "<i>Error='{$err}'</i></p>";
        if ($rez) {
            print "<b>Cannot check if connection failed.</b> The Connect() function returned true.</p>";
        }
//.........这里部分代码省略.........
开发者ID:mvpphet,项目名称:IntranetPaper,代码行数:101,代码来源:test.php

示例9: UnixDate

 function UnixDate($v)
 {
     global $ADODB_sybase_mths;
     //Dec 30 2000 12:00AM
     // added fix by Toni for day 15 Mar 2001
     if (!ereg("([A-Za-z]{3})[-/\\. ]([0-9 ]{1,2})[-/\\. ]([0-9]{4}))", $v, $rr)) {
         return parent::UnixDate($v);
     }
     if ($rr[3] <= 1970) {
         return 0;
     }
     $themth = substr(strtoupper($rr[1]), 0, 3);
     $themth = $ADODB_sybase_mths[$themth];
     if ($themth <= 0) {
         return false;
     }
     // h-m-s-MM-DD-YY
     return mktime(0, 0, 0, $themth, $rr[2], $rr[3]);
 }
开发者ID:qoire,项目名称:portal,代码行数:19,代码来源:adodb-sybase.inc.php

示例10: testdb

function testdb(&$db, $createtab = "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
{
    global $ADODB_vers, $ADODB_CACHE_DIR, $ADODB_FETCH_MODE, $HTTP_GET_VARS, $ADODB_COUNTRECS;
    ?>
	<form method=GET>
	</p>
	<table width=100% ><tr><td bgcolor=beige>&nbsp;</td></tr></table>
	</p>
<?php 
    $create = false;
    global $EXECS, $CACHED;
    $EXECS = 0;
    $CACHED = 0;
    $db->fnExecute = 'CountExecs';
    $db->fnCacheExecute = 'CountCachedExecs';
    $ADODB_CACHE_DIR = dirname(TempNam('/tmp', 'testadodb'));
    $db->debug = false;
    //print $db->UnixTimeStamp('2003-7-22 23:00:00');
    $phpv = phpversion();
    if (defined('ADODB_EXTENSION')) {
        $ext = ' &nbsp; Extension ' . ADODB_EXTENSION . ' installed';
    } else {
        $ext = '';
    }
    print "<h3>ADODB Version: {$ADODB_vers} Host: <i>{$db->host}</i> &nbsp; Database: <i>{$db->database}</i> &nbsp; PHP: {$phpv} {$ext}</h3>";
    $arr = $db->ServerInfo();
    print_r($arr);
    $e = error_reporting(E_ALL - E_WARNING);
    flush();
    print "<i>date1</i> (1969-02-20) = " . $db->DBDate('1969-2-20');
    print "<br><i>date1</i> (1999-02-20) = " . $db->DBDate('1999-2-20');
    print "<br><i>date2</i> (1970-1-2) = " . $db->DBDate(24 * 3600) . "<p>";
    print "<i>ts1</i> (1999-02-20 3:40:50) = " . $db->DBTimeStamp('1999-2-20 13:40:50');
    print "<br><i>ts2</i> (1999-02-20) = " . $db->DBTimeStamp('1999-2-20');
    print "<br><i>ts3</i> (1970-1-2 +/- timezone) = " . $db->DBTimeStamp(24 * 3600);
    print "<br> Fractional TS (1999-2-20 13:40:50.91): " . $db->DBTimeStamp($db->UnixTimeStamp('1999-2-20 13:40:50.91+1'));
    $dd = $db->UnixDate('1999-02-20');
    print "<br>unixdate</i> 1999-02-20 = " . date('Y-m-d', $dd) . "<p>";
    // mssql too slow in failing bad connection
    if ($db->databaseType != 'mssql') {
        print "<p>Testing bad connection. Ignore following error msgs:<br>";
        $db2 = ADONewConnection();
        $rez = $db2->Connect("bad connection");
        $err = $db2->ErrorMsg();
        print "<i>Error='{$err}'</i></p>";
        if ($rez) {
            print "<b>Cannot check if connection failed.</b> The Connect() function returned true.</p>";
        }
    }
    error_reporting($e);
    flush();
    //$ADODB_COUNTRECS=false;
    $rs = $db->Execute('select * from adoxyz order by id');
    //print_r($rs);
    //OCIFetchStatement($rs->_queryID,$rez,0,-1);//,OCI_ASSOC | OCI_FETCHSTATEMENT_BY_ROW);
    //print_r($rez);
    //die();
    if ($rs === false) {
        $create = true;
    } else {
        $rs->Close();
    }
    //if ($db->databaseType !='vfp') $db->Execute("drop table ADOXYZ");
    if ($create) {
        if (false && $db->databaseType == 'ibase') {
            print "<b>Please create the following table for testing:</b></p>{$createtab}</p>";
            return;
        } else {
            $db->debug = 1;
            $e = error_reporting(E_ALL - E_WARNING);
            $db->Execute($createtab);
            error_reporting($e);
        }
    }
    $rs =& $db->Execute("delete from ADOXYZ");
    // some ODBC drivers will fail the drop so we delete
    if ($rs) {
        if (!$rs->EOF) {
            print "<b>Error: </b>RecordSet returned by Execute('delete...') should show EOF</p>";
        }
        $rs->Close();
    } else {
        print "err=" . $db->ErrorMsg();
    }
    print "<p>Test select on empty table</p>";
    $rs =& $db->Execute("select * from ADOXYZ where id=9999");
    if ($rs && !$rs->EOF) {
        print "<b>Error: </b>RecordSet returned by Execute(select...') on empty table should show EOF</p>";
    }
    if ($rs) {
        $rs->Close();
    }
    flush();
    //$db->debug=true;
    print "<p>Testing Commit: ";
    $time = $db->DBDate(time());
    if (!$db->BeginTrans()) {
        print '<b>Transactions not supported</b></p>';
        if ($db->hasTransactions) {
            Err("hasTransactions should be false");
//.........这里部分代码省略.........
开发者ID:alexpagnoni,项目名称:adodb,代码行数:101,代码来源:test.php

示例11: DBDate

 /**
  * Converts a date "d" to a string that the database can understand.
  *
  * @param d	a date in Unix date time format.
  *
  * @return  date string in database date format
  */
 function DBDate($d)
 {
     // note that we are limited to 1970 to 2038
     if (empty($d) && $d !== 0) {
         return 'null';
     }
     if (is_string($d)) {
         if ($this->isoDates) {
             return "'{$d}'";
         } else {
             $d = ADORecordSet::UnixDate($d);
         }
     }
     return date($this->fmtDate, $d);
 }
开发者ID:qoire,项目名称:portal,代码行数:22,代码来源:adodb.inc.php

示例12: DBDate

	function DBDate($d,$isfld=false)
	{
		if (empty($d) && $d !== 0) return 'null';
		if ($isfld) return 'TO_DATE('.$d.",'".$this->dateformat."')";

		if (is_string($d)) $d = ADORecordSet::UnixDate($d);

		if (is_object($d)) $ds = $d->format($this->fmtDate);
		else $ds = adodb_date($this->fmtDate,$d);

		return "TO_DATE(".$ds.",'".$this->dateformat."')";
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:12,代码来源:adodb-oci8.inc.php


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