typecho 归档时间格式修改

野生健康菌 学习笔记


<?php if (!empty($this->options->sidebarBlock) && in_array('ShowArchive', $this->options->sidebarBlock)): ?>
    <section class="widget">
        <h3 class="widget-title"><?php _e('归档'); ?></h3>
            <ul class="widget-list">
                <?php \Widget\Contents\Post\Date::alloc('type=month&format=Y年m月')
                    ->parse('<li><a href="{permalink}">{date}</a></li>'); ?>
            </ul>
    </section>
<?php endif; ?>

type=month&format=Y年m月 修改 format= 后边的格式就可以了。

("F j, Y, g:i a");                   // March 10, 2001, 5:16 pm
("m.d.y");                           // 03.10.01
("j, n, Y");                         // 10, 3, 2001
("Ymd");                             // 20010310
('h-i-s, j-m-y, it is w Day z ');    // 05-16-17, 10-03-01, 1631 1618 6 Fripm01
('\i\t \i\s \t\h\e jS \d\a\y.');     // It is the 10th day.
("D M j G:i:s T Y");                 // Sat Mar 10 15:16:08 MST 2001
('H:m:s \m \i\s\ \m\o\n\t\h');       // 17:03:17 m is month
("H:i:s");                           // 17:16:17
("Y-m-d H:i:s");                     // 2001-03-10 17:16:18

typecho

添加新评论