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


PHP format_datetime函数代码示例

本文整理汇总了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');
 }
开发者ID:reverseproductions,项目名称:socialigniter,代码行数:30,代码来源:users.php

示例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;
}
开发者ID:gblok,项目名称:rsc,代码行数:7,代码来源:discussion_functions.php

示例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';
    }
}
开发者ID:slemoigne,项目名称:sympal,代码行数:16,代码来源:SympalContentSlotHelper.php

示例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;
 }
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:10,代码来源:MY_date_helper.php

示例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');
     }
 }
开发者ID:Ekleog,项目名称:platal,代码行数:11,代码来源:group.php

示例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;
     }
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:18,代码来源:ApiController.class.php

示例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;
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:38,代码来源:Object.class.php

示例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>
开发者ID:469306621,项目名称:Languages,代码行数:31,代码来源:update_permissions.php

示例9: foreach

                  <p>...para a próxima transmissão</p>
                </div>
                <p class="proximos">Pr&oacute;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();
开发者ID:GustavoAdolfo,项目名称:cmais-frontend-2,代码行数:31,代码来源:_display-2c-broadcast2.php

示例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 .= '&nbsp;<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(' ', '&nbsp;', 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 
        }
    }
开发者ID:howardgrigg,项目名称:jethro-pmm,代码行数:101,代码来源:roster_view.class.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/>
开发者ID:alex1818,项目名称:TestReportCenter,代码行数:31,代码来源:environmentBuildSuccess.rss.php

示例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);
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:view.php

示例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;
}
开发者ID:abhinay100,项目名称:feng_app,代码行数:95,代码来源:format.php

示例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 
开发者ID:bklein01,项目名称:Project-Pier,代码行数:31,代码来源:view.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();
    ?>
开发者ID:howardgrigg,项目名称:jethro-pmm,代码行数:31,代码来源:single_note.template.php


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