本文整理汇总了PHP中ADORecordSet::UnixTimeStamp方法的典型用法代码示例。如果您正苦于以下问题:PHP ADORecordSet::UnixTimeStamp方法的具体用法?PHP ADORecordSet::UnixTimeStamp怎么用?PHP ADORecordSet::UnixTimeStamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADORecordSet
的用法示例。
在下文中一共展示了ADORecordSet::UnixTimeStamp方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DBTimeStamp
function DBTimeStamp($ts)
{
if (is_string($ts)) {
$d = ADORecordSet::UnixTimeStamp($ts);
}
return 'TO_DATE(' . date($this->fmtTimeStamp, $ts) . ",'RRRR-MM-DD, HH:MI:SS AM')";
}
示例2: DBTimeStamp
function DBTimeStamp($ts)
{
if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
if (is_object($ts)) $ds = $ts->format($this->fmtDate);
else $ds = adodb_date($this->fmtTimeStamp,$ts);
return 'TO_DATE('.$ds.",'RRRR-MM-DD, HH:MI:SS AM')";
}
示例3: DBTimeStamp
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if (is_string($ts)) {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
return 'TO_DATE(' . date($this->fmtTimeStamp, $ts) . ",'RRRR-MM-DD, HH:MI:SS AM')";
}
示例4: DBTimeStamp
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) return 'null';
if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
return 'TO_DATE('.adodb_date("'Y-m-d H:i:s'",$ts).",'RRRR-MM-DD, HH24:MI:SS')";
}
示例5: DBTimeStamp
function DBTimeStamp($ts, $isfld = false)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if ($isfld) {
return 'TO_DATE(substr(' . $ts . ",1,19),'RRRR-MM-DD, HH24:MI:SS')";
}
if (is_string($ts)) {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
return 'TO_DATE(' . adodb_date("'Y-m-d H:i:s'", $ts) . ",'RRRR-MM-DD, HH24:MI:SS')";
}
示例6: UnixTimeStamp
function UnixTimeStamp($v)
{
global $ADODB_sybase_mths;
//Dec 30 2000 12:00AM
if (!ereg("([A-Za-z]{3})[-/\\. ]([0-9]{1,2})[-/\\. ]([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})", $v, $rr)) {
return parent::UnixTimeStamp($v);
}
if ($rr[3] <= 1970) {
return 0;
}
$themth = substr(strtoupper($rr[1]), 0, 3);
$themth = $ADODB_sybase_mths[$themth];
if ($themth <= 0) {
return false;
}
if (strtoupper($rr[6]) == 'P') {
if ($rr[4] < 12) {
$rr[4] += 12;
}
} else {
if ($rr[4] == 12) {
$rr[4] = 0;
}
}
// h-m-s-MM-DD-YY
return mktime($rr[4], $rr[5], 0, $themth, $rr[2], $rr[3]);
}
示例7: DBTimeStamp
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if (is_string($ts)) {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
return 'TO_DATE(' . adodb_date($this->fmtTimeStamp, $ts) . ",'YYYY-MM-DD HH24:MI:SS')";
}
示例8: DBTimeStamp
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if (is_string($ts)) {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
// See #8387 for more details
// original: return 'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'YYYY-MM-DD HH24:MI:SS')";
return adodb_date($this->fmtTimeStamp, $ts);
}
示例9: DBTimeStamp
/**
* Converts a timestamp "ts" to a string that the database can understand.
*
* @param ts a timestamp in Unix date time format.
*
* @return timestamp string in database timestamp format
*/
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if (is_string($ts)) {
if ($this->isoDates) {
return "'{$ts}'";
} else {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
}
return date($this->fmtTimeStamp, $ts);
}
示例10: DBTimeStamp
function DBTimeStamp($ts,$isfld=false)
{
if (empty($ts) && $ts !== 0) return 'null';
if ($isfld) return 'TO_DATE(substr('.$ts.",1,19),'RRRR-MM-DD, HH24:MI:SS')";
if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
if (is_object($ts)) $tss = $ts->format("'Y-m-d H:i:s'");
else $tss = adodb_date("'Y-m-d H:i:s'",$ts);
return 'TO_DATE('.$tss.",'RRRR-MM-DD, HH24:MI:SS')";
}