本文整理汇总了PHP中TimeDate::toDatabaseDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP TimeDate::toDatabaseDateTime方法的具体用法?PHP TimeDate::toDatabaseDateTime怎么用?PHP TimeDate::toDatabaseDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeDate
的用法示例。
在下文中一共展示了TimeDate::toDatabaseDateTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
//.........这里部分代码省略.........
';
}
?>
<tr>
<td style="text-align:center;"><?php
echo $jLang['_COM_DASH_COMMENT'];
?>
: <?php
echo $commentArea;
?>
</td>
</tr>
<?php
}
?>
<tr>
<td style='text-align:center' id='submittipsbuttonarea'><?php
echo $disabled != "disabled" ? "<input type='button' class='button' name='submittips' id='submittips' value='" . $jLang['_COM_TIPS_SAVE'] . "' {$checkComment} />" : "";
?>
</td>
</tr>
<tr>
<td style='text-align:center; padding-top:5px; display:none;' id='ajaxloading'></td>
</tr>
</table>
</div>
<input type='hidden' name='round_id' value='<?php
echo $this->jRound->id;
?>
' />
</form>
<?php
} else {
if ($this->jRound->exists() and TimeDate::toDatabaseDateTime($this->jRound->start_time) > gmdate('Y-m-d H:i:s')) {
?>
<h2 style='text-align:center'><?php
echo $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round;
?>
</h2>
<h2 style='text-align:center'><?php
echo $jLang['_COM_ROUND_CLOSED'];
?>
</h2>
<?php
} else {
if ($this->jRound->exists()) {
?>
<h2 style='text-align:center'><?php
echo $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round;
?>
</h2>
<?php
} else {
?>
<h2 style='text-align:center'><?php
echo $jLang['_COM_ROUND_NOGAMES'];
?>
</h2>
<?php
}
}
}
if ($this->jRound->getStatus() === false and !empty($jTipsCurrentUser->id)) {
$userTime = strtotime($this->jRound->start_time) - TimeDate::getOffset(false);
$targetTime = date('Y-m-d H:i:s', $userTime);
if ($jTips['ShowJSCountdown'] == 1) {
示例2: jTipsGetParam
//parse the game time if necessary
if ($jSeason->game_times and jTipsGetParam($_REQUEST['start_time_date'], $i, false)) {
$start_time_date = jTipsGetParam($_REQUEST['start_time_date'], $i, strftime($jTips['DateFormat'])) . " ";
$start_minute = jTipsGetParam($_REQUEST['start_time_minute'], $i, '');
$start_time_time = jTipsGetParam($_REQUEST['start_time_hour'], $i, '') . ":" . str_pad($start_minute, 2, '0', STR_PAD_LEFT) . jTipsGetParam($_REQUEST['start_time_meridiem'], $i, '');
if (!preg_match('/\\d/', $start_time_time)) {
$start_time_time = strftime($jTips['TimeFormat']);
}
$start_time = $start_time_date . " " . $start_time_time;
//jTipsDebug($start_time);
//BUG 263 - set the date fields if we are in J1.0
if (!isJoomla15()) {
$start_time = TimeDate::toDisplayDate($start_time_date) . " " . $start_time_time;
}
//jTipsDebug($start_time);
$jGame->start_time = TimeDate::toDatabaseDateTime($start_time);
//jTipsDebug($jGame->start_time);
} else {
if ($jRound->getStatus() === false) {
$jGame->start_time = null;
}
}
//set the game scores
if ($jRound->getStatus() !== FALSE) {
$jGame->home_score = jTipsGetParam($_REQUEST['home_score'], $i, null);
$jGame->away_score = jTipsGetParam($_REQUEST['away_score'], $i, null);
/*
* Can't put this code here since it will destroy the
* team ladder and standings
*
* if ($jSeason->team_starts > 0) {
示例3: display
//.........这里部分代码省略.........
$right_score_field = $right . '_score';
?>
<th <?php
echo $tags;
?>
><?php
echo $jGame->{$left_score_field} . " - " . $jGame->{$right_score_field};
?>
</th>
<?php
}
?>
<td><?php
if (!empty($jGame->description)) {
$description = nl2br(stripslashes($jGame->description));
echo jTipsToolTip($description, $jLang['_COM_GAME_ADDITIONAL_INFO']);
} else {
echo " ";
}
?>
</td>
</tr>
<?php
$rowIndex++;
}
?>
</table>
<div><?php
$this->renderByes();
?>
</div>
<?php
} else {
if ($this->jRound->exists() and TimeDate::toDatabaseDateTime($this->jRound->start_time) > gmdate('Y-m-d H:i:s')) {
?>
<h2 style='text-align: center'><?php
echo $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round;
?>
</h2>
<h2 style='text-align: center'><?php
echo $jLang['_COM_ROUND_CLOSED'];
?>
</h2>
<?php
} else {
if ($this->jRound->exists()) {
?>
<h2 style='text-align: center'><?php
echo $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round;
?>
</h2>
<?php
} else {
?>
<h2 style='text-align: center'><?php
echo $jLang['_COM_ROUND_NOGAMES'];
?>
</h2>
<?php
}
}
}
if ($this->jRound->getStatus() === false) {
$userTime = strtotime($this->jRound->start_time) - TimeDate::getOffset(false);
$targetTime = date('Y-m-d H:i:s', $userTime);
if ($jTips['ShowJSCountdown'] == 1) {
示例4: parseDataType
function parseDataType(&$data, $column, $field)
{
global $database;
$dataval = $data[$column];
switch ($field['type']) {
case 'int':
if (is_numeric($dataval)) {
return $dataval;
} else {
return 0;
}
break;
case 'double':
case 'float':
if (is_float($dataval)) {
return $dataval;
} else {
return 0;
}
break;
case 'bool':
if ($dataval == 1 or preg_match('/yes/i', $dataval)) {
return 1;
} else {
return 0;
}
break;
case 'date':
//return toDbDate($dataval);
return TimeDate::toDatabaseDate($dataval);
break;
case 'datetime':
//return toDbDateTime($dataval);
return TimeDate::toDatabaseDateTime($dataval);
break;
case 'time':
//return toDbTime($dataval);
return TimeDate::toDatabaseTime($dataval);
break;
case 'relate':
//Locate an existing record matching the given data value
//If nothing found create a skeleton record with the supplied data
//Return key of supplied data in related table.
$class = $field['related'];
$obj = new $class($database);
$related_fields = $field['related_fields'];
if (count($related_fields) > 1) {
$values = preg_split('/[\\s]+/', $dataval);
} else {
$values = array($dataval);
}
$max = min(count($values), count($related_fields));
$params = array();
for ($i = 0; $i < $max; $i++) {
$params[$related_fields[$i]] = $values[$i];
}
if (isset($field['dependency']) and !empty($field['dependency'])) {
$params[$field['dependency']['key']] = getDependentField($field, $data, $_POST['importFields']);
}
//jTipsDebug($_POST);
//jTipsDebug($dataval);
//jTipsDebug($field);
//jTipsDebug($params);
//die();
$obj->loadByParams($params);
$rel_key = $field['related_key'];
if (isset($obj->{$rel_key}) and !empty($rel_key)) {
return $obj->{$rel_key};
} else {
if ($field['required']) {
$obj->bind($params);
$obj->save();
return $obj->{$rel_key};
} else {
return $field['default'];
}
}
break;
case 'virtual':
continue;
break;
case 'text':
default:
return mysql_real_escape_string($dataval);
break;
}
}