WordPress时间函数the_tiem()详解
来源:互联网 发布:算法导论在线阅读 编辑:程序博客网 时间:2024/05/12 01:26
使用 WordPress 建站,不得不接触到时间函数 the_time(),因为加上文章的发表日期或评论的发表日期是非常有必要的。但是 the_time() 默认的格式只有时间,比如 “下午5:06” 。这样的格式是不是不太满意呢? 对于中国人,比较习惯以下的时间格式:
- 12-10
- 2013-12-10
- 2013年12月10日 星期一
- 10:35:28
如何让间函数 the_time() 输出上面的格式呢?我们必要了解 the_time() 的各项参数:
了解了 the_time() 的参数,下面就举几个列子:
1、输出 2013-12-10 格式:
<?php the_time('Y-m-d'); ?>
注意:Y 是大写,这样才会输出完整的年分 2013,小写的话会输出 13。
2、输出时间,如:10:35:28:
<?php the_time('G:i:s'); ?>
3、输出 2013年12月10日 格式:
<?php the_time('Y年m月d日'); ?>
4、输出 2013年12月10日 星期二 格式:
<?php the_time('Y年m月d日 l'); ?>
5、输出完整的日期,如 2013年12月10日 星期二 10:35:28:
<?php the_time('Y年m月d日 l G:i:s'); ?>
需要其他时间格式,可以根据上面的参数自行配置。
0 0
- WordPress时间函数the_tiem()详解
- WordPress分页函数详解
- WordPress部分函数详解
- [WordPress]时间函数和参数
- wordpress 函数详解 mysql2date , current_time
- WordPress的body_class()函数详解
- wordpress时间函数the_time的用法
- wordpress分类列表函数:wp_list_categories 参数详解
- wordpress 函数详解 add_option delete_option update_option get_option
- WordPress文章分页wp_link_pages()函数详解
- ASP时间函数详解
- Asp 时间函数详解
- sql时间函数详解
- SQL时间函数详解
- sql时间函数详解
- linux时间函数详解
- PHP时间函数详解
- PHP时间函数详解
- IOS下利用ziparchive解压缩zip文件
- linux下查看用户属于哪个用户组
- 面向对象设计模式——工厂方法模式(学习笔记)
- Object.defineProperty()/Object.keys()
- ABAP FIELD-SYMBOLS 有大作用- 将没有可改参数的增强出口变得也能改主程序的值了
- WordPress时间函数the_tiem()详解
- oracle如何干预执行计划-使用hints
- 优秀的开源库
- wav格式 常识
- DL-SFA: Deeply-Learned Slow Feature Analysis for Action Recognition(泛读)
- 基于二叉树SVM多类分类算法研究
- 推荐一个非常不错的Linux资源网站
- How will the new iPhone screen sizes affect iOS developers?
- MFC几个关于字符串处理的全局函数