本文整理汇总了PHP中format_datetime函数的典型用法代码示例。如果您正苦于以下问题:PHP format_datetime函数的具体用法?PHP format_datetime怎么用?PHP format_datetime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format_datetime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
// Get Users
$users = $this->social_auth->get_users('active', 1);
$users_view = NULL;
// Title Stuff
$this->data['page_title'] = 'Users';
$this->data['sub_title'] = 'Manage';
// Users View Loop
foreach ($users as $user) {
$this->data['user_id'] = $user->user_id;
$this->data['name'] = $user->name;
$this->data['avatar'] = $this->social_igniter->profile_image($user->user_id, $user->image, $user->email);
$this->data['profile'] = base_url() . 'profile/' . $user->username;
$this->data['created_on'] = format_datetime('SIMPLE_ABBR', $user->created_on);
$this->data['last_login'] = format_datetime('SIMPLE_TIME_ABBR', $user->last_login);
// Alerts
$this->data['user_alerts'] = item_alerts_user($user);
// Actions
$this->data['user_state'] = item_user_state($user->active);
$this->data['user_edit'] = base_url() . 'users/manage/' . $user->user_id;
$this->data['user_delete'] = base_url() . 'api/users/destroy/id/' . $user->user_id;
// View
$users_view .= $this->load->view(config_item('dashboard_theme') . '/partials/item_users.php', $this->data, true);
}
// Final Output
$this->data['users_view'] = $users_view;
$this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
$this->render('dashboard_wide');
}
示例2: discGetDiscussion
function discGetDiscussion($DID)
{
$q = db_query("select DID, Author, Body, add_time, Topic, name AS product_name, " . " " . PRODUCTS_TABLE . ".productID AS productID from " . DISCUSSIONS_TABLE . ", " . PRODUCTS_TABLE . " where " . DISCUSSIONS_TABLE . ".productID=" . PRODUCTS_TABLE . ".productID AND DID=" . (int) $DID);
$row = db_fetch_row($q);
$row["add_time"] = format_datetime($row["add_time"]);
return $row;
}
示例3: render_content_date_published
/**
* Render the date published for a content record
*
* @param sfSympalContent $content
* @param string $slot
* @return string $datePublished
*/
function render_content_date_published(sfSympalContent $content, $slot)
{
if ($content->date_published) {
sfSympalToolkit::loadHelpers('Date');
return format_datetime($content->date_published, sfSympalConfig::get('date_published_format'));
} else {
return '0000-00-00';
}
}
示例4: output_datetime
function output_datetime($date = 'now', $input = FALSE)
{
if ($date == NULL) {
return '';
}
$abbr = $input ? '' : '<abbr title="' . format_datetime($date) . '">';
$date_output = date('d-m-Y H:i', strtotime($date));
$abbr_end = $input ? '' : '</abbr>';
return $abbr . $date_output . $abbr_end;
}
示例5: __construct
private function __construct(array $data)
{
foreach ($data as $key => $value) {
$this->data[$key] = $value;
}
$this->id = intval($this->data['id']);
$this->shortname = $this->data['diminutif'];
if (!is_null($this->axDate)) {
$this->axDate = format_datetime($this->axDate, '%d/%m/%Y');
}
}
示例6: get_comments
private function get_comments($request)
{
try {
$object = Objects::findObject($request['oid']);
$comments = $object->getComments();
$clean_comments = array();
foreach ($comments as $comment) {
$user_name = $comment->getCreatedByDisplayName();
$updated_on = format_datetime($comment->getUpdatedOn());
$text = escape_html_whitespace(convert_to_links(clean($comment->getText())));
$clean_comment = array("author" => $user_name, "date" => $updated_on, "text" => $text);
$clean_comments[] = $clean_comment;
}
return $this->response('json', $clean_comments);
} catch (Exception $exception) {
throw $exception;
}
}
示例7: getArrayInfo
function getArrayInfo($include_trash_info = false, $include_archive_info = false) {
if ($this->getCreatedOn()){
$dateCreated = $this->getCreatedOn()->isToday() ? lang('today') ." ". format_time($this->getCreatedOn()) : format_datetime($this->getCreatedOn());
}
if ($this->getUpdatedOn()){
$dateUpdated = $this->getUpdatedOn()->isToday() ? lang('today') ." ". format_time($this->getUpdatedOn()) : format_datetime($this->getUpdatedOn());
}
$info = array(
'object_id' => $this->getId(),
'ot_id' => $this->getObjectTypeId(),
'name' => $this->getName(),
'type' => $this->getObjectTypeName(),
'icon' => $this->getType()->getIconClass(),
'createdBy' => $this->getCreatedByDisplayName(),
'createdById' => $this->getCreatedById(),
'dateCreated' => $dateCreated,
'updatedBy' => $this->getUpdatedByDisplayName(),
'updatedById' => $this->getUpdatedById(),
'dateUpdated' => $dateUpdated,
'url' => $this->getViewUrl()
);
if ($include_trash_info) {
$dateTrashed = $this->getTrashedOn() instanceof DateTimeValue ? ($this->getTrashedOn()->isToday() ? format_time($this->getTrashedOn()) : format_datetime($this->getTrashedOn())) : lang('n/a');
$info['deletedBy'] = $this->getTrashedByDisplayName();
$info['deletedById'] = $this->getColumnValue('trashed_by_id');
$info['dateDeleted'] = $dateTrashed;
}
if ($include_archive_info) {
$dateArchived = $this->getArchivedOn() instanceof DateTimeValue ? ($this->getArchivedOn()->isToday() ? format_time($this->getArchivedOn()) : format_datetime($this->getArchivedOn())) : lang('n/a');
$archived_by = Contacts::findById($this->getArchivedById());
$info['archivedBy'] = $archived_by instanceof Contact ? $archived_by->getObjectName() : lang('n/a');
$info['archivedById'] = $this->getArchivedById();
$info['dateArchived'] = $dateArchived;
}
return $info;
}
示例8: checkbox_field
?>
<tr>
<td><?php
echo checkbox_field('project_' . $project->getId(), $company->isProjectCompany($project), array('id' => 'projectPermissionsCheckbox' . $project->getId(), 'disabled' => !logged_user()->isProjectUser($project)));
?>
</td>
<td>
<label for="projectPermissionsCheckbox<?php
echo $project->getId();
?>
" class="checkbox normal">
<?php
if ($project->isCompleted()) {
?>
<del><span title="<?php
echo lang('project completed on by', format_datetime($project->getCompletedOn()), $project->getCompletedByDisplayName());
?>
"><?php
echo clean($project->getName());
?>
</span></del>
<?php
} else {
?>
<?php
echo clean($project->getName());
}
// if
?>
</label>
</td>
示例9: foreach
<p>...para a próxima transmissão</p>
</div>
<p class="proximos">Próximos programas ao vivo:</p>
</div>
<!-- /contador -->
<ul class="lista-calendario grid2">
<?php
foreach ($displays as $k => $d) {
?>
<li>
<div class="barra-grade">
<p class="hora"><?php
echo format_datetime($d->getDateStart(), "d/M HH:mm");
?>
</p>
<a href="#" class="btn-toggle"><?php
echo $d->Program->getTitle();
?>
</a>
<a href="#" class="botao btn-toggle"></a>
</div>
<div class="grade toggle" style="display:none; width:auto; padding-bottom:25px;">
<div class="capa-foto" style="width:auto;">
<img src="<?php
echo $d->retriveLiveImage();
?>
" alt="<?php
echo $d->retriveTitle();
示例10: printView
//.........这里部分代码省略.........
<input type="submit" value="Send" />
<input type="button" onclick="$(this).parents('form').toggle(); $(this).parents('tr:first').removeClass('tblib-hover')" value="Cancel" />
</div>
</form>
<?php
}
}
}
?>
</td>
<?php
$last_congid = NULL;
foreach ($this->_members as $id => $mdetail) {
$td_class = '';
if ($mdetail['congregationid'] != $last_congid) {
$td_class = 'thick-left-border';
$last_congid = $mdetail['congregationid'];
}
?>
<td class="<?php
echo $td_class;
?>
">
<?php
if ($mdetail['role_id']) {
if ($editing && empty($mdetail['readonly'])) {
$currentval = array();
foreach (array_get($ddetail['assignments'], $mdetail['role_id'], array()) as $pid => $pdetails) {
$currentval[$pid] = $pdetails['name'];
}
if (empty($role_objects[$mdetail['role_id']])) {
$role_objects[$mdetail['role_id']] =& $GLOBALS['system']->getDBObject('roster_role', $mdetail['role_id']);
}
if (empty($role_objects[$mdetail['role_id']])) {
// must've been a problem
continue;
}
$role_objects[$mdetail['role_id']]->printChooser($date, $currentval);
} else {
$names = array();
foreach (array_get($ddetail['assignments'], $mdetail['role_id'], array()) as $personid => $vs) {
if (!$public) {
$n = '<a href="' . BASE_URL . '?view=persons&personid=' . $personid . '" title="Assigned by ' . ents($vs['assigner']) . ' on ' . format_datetime($vs['assignedon']) . '">' . nbsp(ents($vs['name'])) . '</a>';
if (empty($vs['email'])) {
$n .= ' <img src="' . BASE_URL . 'resources/img/no_email.png" style="display:inline" title="No Email Address" />';
}
$names[] = $n;
} else {
$names[] = nbsp($vs['name']);
}
}
echo implode("<br />", $names);
}
} else {
if (!empty($ddetail['service'][$mdetail['congregationid']])) {
if ($public && (!defined('SHOW_SERVICE_NOTES_PUBLICLY') || !SHOW_SERVICE_NOTES_PUBLICLY)) {
// no notes in public view
unset($ddetail['service'][$mdetail['congregationid']]['notes']);
}
$dummy_service->populate($ddetail['service'][$mdetail['congregationid']]['id'], $ddetail['service'][$mdetail['congregationid']]);
$dummy_service->printFieldvalue($mdetail['service_field']);
}
}
?>
</td>
<?php
}
if (!$public && count($this->_members) > REPEAT_DATE_THRESHOLD) {
?>
<td class="nowrap thick-left-border">
<strong><?php
echo str_replace(' ', ' ', date('j M y', strtotime($date)));
?>
</strong>
</td>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
<?php
if (!$public && count($to_print) > 6) {
$this->_printTableFooter($editing, $public);
}
?>
</table>
<?php
if ($editing) {
?>
<input type="submit" class="btn" value="Save" accesskey="s" />
</form>
<?php
}
}
示例11: date
<language>en-us</language>
<pubDate><?php
echo date(DATE_RSS);
?>
</pubDate>
<?php
foreach ($sessionsForImages as $data) {
?>
<item>
<title><?php
echo $data["name"];
?>
</title>
<pubDate><?php
echo date(DATE_RSS, strtotime(format_datetime($data["created_at"], "y-MM-dd HH:mm")));
?>
</pubDate>
<description>
Total test cases: <?php
echo $data["total"];
?>
<br/>
Passed: <?php
echo $data["pass"];
?>
<br/>
Failed: <?php
echo $data["fail"];
?>
<br/>
示例12: get_url
}
$conversation_block .= '<td style="width:20px;'.$read_style.'">';
if ($show_user_icon) {
$conversation_block .= '<div class="db-ico ico-user"></div>';
}
$info_text = $info->getTextBody();
if (strlen_utf($info_text) > 90) $info_text = substr_utf($info_text, 0, 90) . "...";
$view_url = get_url('mail', 'view', array('id' => $info->getId(), 'replace' => 1));
$conversation_block .= '<td>';
$conversation_block .= ' <a style="'.$read_style.'" class="internalLink" href="'.$view_url.'" onclick="og.openLink(\''.$view_url.'\');return false;" title="'.$info->getFrom().'">';
$conversation_block .= $from;
if (!$is_current) $conversation_block .= ' </a><span class="desc">- '.$info_text.'</span></td>';
$info_date = $info->getReceivedDate() instanceof DateTimeValue ? ($info->getReceivedDate()->isToday() ? format_time($info->getReceivedDate()) : format_datetime($info->getReceivedDate())) : lang('n/a');
$conversation_block .= '</td><td style="text-align:right;padding-right:3px"><span class="desc">'. lang('date').': </span>'. $info_date .'</td>';
} //foreach
$conversation_block .= '</table>';
$conversation_block .= '</div>';
} else {
$conversation_block = '';
}
if($email->getBodyHtml() != ''){
if (defined('SANDBOX_URL')) {
$html_content = $email->getBodyHtml();
// prevent some outlook malformed tags
if(substr_count($html_content, "<style") != substr_count($html_content, "</style>") && substr_count($html_content, "/* Font Definitions */") >= 1) {
$p1 = strpos($html_content, "/* Font Definitions */", 0);
示例13: format_value_to_print
function format_value_to_print($col, $value, $type, $obj_type_id, $textWrapper = '', $dateformat = 'Y-m-d')
{
switch ($type) {
case DATA_TYPE_STRING:
if (preg_match(EMAIL_FORMAT, strip_tags($value))) {
$formatted = strip_tags($value);
} else {
if ($col == 'is_user') {
$formatted = $value == 1 ? lang('yes') : lang('no');
} else {
if (strpos($value, "�") !== false) {
$value = preg_replace('/\\xA0/s', ' ', $value);
}
$value = utf8_safe($value);
$formatted = $textWrapper . $value . $textWrapper;
}
}
break;
case DATA_TYPE_INTEGER:
if ($col == 'priority') {
switch ($value) {
case 100:
$formatted = lang('low priority');
break;
case 200:
$formatted = lang('normal priority');
break;
case 300:
$formatted = lang('high priority');
break;
case 400:
$formatted = lang('urgent priority');
break;
default:
$formatted = clean($value);
}
} elseif ($col == 'time_estimate') {
if ($value > 0) {
$formatted = DateTimeValue::FormatTimeDiff(new DateTimeValue(0), new DateTimeValue($value * 60), 'hm', 60);
} else {
$formatted = clean($value);
}
} else {
$formatted = clean($value);
}
break;
case DATA_TYPE_BOOLEAN:
$formatted = $value == 1 ? lang('yes') : lang('no');
break;
case DATA_TYPE_DATE:
if ($value != 0) {
if (str_ends_with($value, "00:00:00")) {
$dateformat .= " H:i:s";
}
try {
$dtVal = DateTimeValueLib::dateFromFormatAndString($dateformat, $value);
} catch (Exception $e) {
$formatted = $value;
}
if (!isset($formatted)) {
$formatted = format_date($dtVal, null, 0);
}
} else {
$formatted = '';
}
break;
case DATA_TYPE_DATETIME:
if ($value != 0) {
try {
$dtVal = DateTimeValueLib::dateFromFormatAndString("{$dateformat} H:i:s", $value);
} catch (Exception $e) {
$formatted = $value;
}
if ($dtVal instanceof DateTimeValue) {
if ($obj_type_id == ProjectEvents::instance()->getObjectTypeId() || $obj_type_id == ProjectTasks::instance()->getObjectTypeId()) {
$dtVal->advance(logged_user()->getTimezone() * 3600, true);
}
if ($obj_type_id == ProjectEvents::instance()->getObjectTypeId() && ($col == 'start' || $col == 'duration')) {
$formatted = format_datetime($dtVal);
} else {
$formatted = format_date($dtVal, null, 0);
}
}
} else {
$formatted = '';
}
break;
default:
$formatted = $value;
}
if ($formatted == '') {
$formatted = '--';
}
return $formatted;
}
示例14: lang
?>
</span></div>
<?php
}
// if
if ($message->getCreatedBy() instanceof User) {
?>
<div class="author"><?php
echo lang('posted on by', format_datetime($message->getCreatedOn()), $message->getCreatedBy()->getCardUrl(), clean($message->getCreatedBy()->getDisplayName()));
?>
</div>
<?php
} else {
?>
<div class="author"><?php
echo lang('posted on', format_datetime($message->getCreatedOn()));
?>
</div>
<?php
}
// if
?>
</div>
<div class="content">
<?php
if ($createdBy instanceof User && $createdBy->getContact()->hasAvatar()) {
?>
<div class="avatar"><img src="<?php
echo $createdBy->getContact()->getAvatarUrl();
?>
" alt="<?php
示例15: foreach
<div class="comments">
<?php
foreach ($entry['comments'] as $comment) {
?>
<blockquote>
<p><?php
echo nl2br(ents(trim($comment['contents'])));
?>
</p>
<small class="author">
Added by
<?php
echo $comment['creator_fn'] . ' ' . $comment['creator_ln'] . ' (#' . $entry['creator'] . ')';
?>
<?php
echo format_datetime($comment['created']);
?>
</small>
</blockquote>
<?php
}
?>
</div>
<?php
}
if (!empty($show_form)) {
?>
<h4>Add Update:</h4>
<?php
$dummy->printUpdateForm();
?>