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')";
 }
	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')";
	}
Esempio n. 3
0
 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')";
 }
	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')";
	}
 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')";
 }
Esempio n. 6
0
 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]);
 }
Esempio n. 7
0
 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')";
 }
Esempio n. 8
0
 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);
 }
Esempio n. 9
0
 /**
  * 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);
 }
Esempio n. 10
0
 function UnixTimeStamp($v)
 {
     global $ADODB_sybase_mths;
     //11.02.2001 Toni Tunkkari toni.tunkkari@finebyte.com
     //Changed [0-9] to [0-9 ] in day conversion
     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]);
 }
Esempio n. 11
0
	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')";
	}