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


PHP DateTime::get_default_date_format方法代码示例

本文整理汇总了PHP中DateTime::get_default_date_format方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTime::get_default_date_format方法的具体用法?PHP DateTime::get_default_date_format怎么用?PHP DateTime::get_default_date_format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DateTime的用法示例。


在下文中一共展示了DateTime::get_default_date_format方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _t

"><?php 
    echo $user->displayname;
    ?>
</a></span>
		</div>

		<div>
			<span class="nothing">&nbsp;</span>
			<span class="aka">

			<?php 
    if (!$user->info->authenticate_time) {
        $last_login_message = _t('has not logged in yet');
    } else {
        $last_login_message = _t('was last seen %1$s at %2$s');
        $last_login_message = sprintf($last_login_message, '<strong>' . date(DateTime::get_default_date_format(), strtotime($user->info->authenticate_time)) . '</strong>', '<strong>' . date(DateTime::get_default_time_format(), strtotime($user->info->authenticate_time)) . '</strong>');
    }
    $message_bits = array();
    $post_statuses = Post::list_post_statuses();
    unset($post_statuses[array_search('any', $post_statuses)]);
    foreach ($post_statuses as $status_name => $status_id) {
        $status_name = Plugins::filter('post_status_display', $status_name);
        $count = Posts::count_by_author($user->id, $status_id);
        if ($count > 0) {
            $message = '<strong><a href="' . Utils::htmlspecialchars(URL::get('admin', array('page' => 'posts', 'user_id' => $user->id, 'type' => Post::type('any'), 'status' => $status_id))) . '">';
            $message .= _n(_t('%1$d %2$s post', array($count, $status_name)), _t('%1$d %2$s posts', array($count, $status_name)), $count);
            $message .= '</a></strong>';
            $message_bits[] = $message;
        }
    }
    if (!empty($message_bits)) {
开发者ID:habari,项目名称:system,代码行数:31,代码来源:users_items.php

示例2: array

        echo $comment->menu->get($theme);
        ?>
		</div>
	</div>

	<div>
		<ul class="meta">
			<li>
				<span class="date"><a href="<?php 
        URL::out('admin', array('page' => 'comments', 'status' => $comment->status, 'year' => $comment->date->year, 'month' => $comment->date->mon));
        ?>
" title="<?php 
        _e('Search for other comments from %s', array($comment->date->format('M, Y')));
        ?>
"><?php 
        $comment->date->out(DateTime::get_default_date_format());
        ?>
</a></span>
				<span class="time"><?php 
        _e('at');
        ?>
 <?php 
        $comment->date->out(DateTime::get_default_time_format());
        ?>
</span>
			</li>
			<li class="comment_author"><?php 
        echo Utils::htmlspecialchars($comment->name);
        ?>
</li>
			<?php 
开发者ID:habari,项目名称:system,代码行数:31,代码来源:comments_items.php

示例3: _e

        } else {
            _e('without author');
        }
        ?>
</span>
			<span class="date"><?php 
        _e('on');
        ?>
 <a href="<?php 
        URL::out('admin', array('page' => 'posts', 'type' => $post->content_type, 'year_month' => $post->pubdate->get('Y-m')));
        ?>
" title="<?php 
        _e('Search for other items from %s', array($post->pubdate->get('M, Y')));
        ?>
"><?php 
        $post->pubdate->out(DateTime::get_default_date_format());
        ?>
</a></span>
			<span class="time"><?php 
        _e('at');
        ?>
 <?php 
        $post->pubdate->out(DateTime::get_default_time_format());
        ?>
</span>
			<div class="actions">
				<?php 
        $post_actions = FormControlDropbutton::create('post' . $post->id . '_postactions');
        $post_actions->append(FormControlSubmit::create('edit')->set_caption(_t('Edit'))->set_url(URL::get('display_publish', $post, false))->set_property('title', _t('Edit \'%s\'', array($post->title)))->set_enable(function ($control) use($post) {
            return ACL::access_check($post->get_access(), 'edit');
        }));
开发者ID:habari,项目名称:system,代码行数:31,代码来源:posts_items.php

示例4: die

<?php

namespace Habari;

if (!defined('HABARI_PATH')) {
    die('No direct access');
}
?>
<div class="textual item"><?php 
$view_url = $comment->post->permalink . '#comment-' . $comment->id;
if ($comment->url != '') {
    printf(_t('<a href="%1$s">Comment</a> by ' . '<a href="%2$s" title="Visit %3$s">%3$s</a> ' . 'posted on <a href="%4$s" title="View post">%5$s</a> ' . 'at <strong>%6$s</strong> ' . 'on <strong>%7$s</strong>'), $view_url, $comment->url, $comment->name, $comment->post->permalink, $comment->post->title, $comment->date->get(DateTime::get_default_time_format()), $comment->date->get(DateTime::get_default_date_format()));
} else {
    printf(_t('<a href="%1$s">Comment</a> by ' . '<strong>%2$s</strong> ' . 'posted on <a href="%3$s" title="View post">%4$s</a> ' . 'at <strong>%5$s</strong> ' . 'on <strong>%6$s</strong>'), $view_url, $comment->name, $comment->post->permalink, $comment->post->title, $comment->date->get(DateTime::get_default_time_format()), $comment->date->get(DateTime::get_default_date_format()));
}
?>
</div>
<?php 
开发者ID:habari,项目名称:system,代码行数:18,代码来源:comment.overview.php


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