格式化显示时间
Jun 08, 2016 pm 05:33 PM制作ASP程序时用DWMX2004系统自带的时间格式化工具就可以方便地实现目标显示格式,可惜PHP模组里没有类似的功能,
不过我们手写几个字符就搞定了
将 $row_rsLesson['N_Date']) 改为你的时间记录字段内容
输出的格式是: 年-月-日 你可以根据要求设定,例如:"m-d" 或者 "mdHi"等
这里用到两个函式 一个 是date() 一个 是strtotime()
date() :传入时间戳值,将时间戳格式化传回
strtotime () 将任何英文文本的日期时间描述解析为 UNIX 时间戳

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to create and name a file/folder based on current timestamp

PHP Warning: date() expects parameter 2 to be long, string given solution

Introduction to methods and usage of using Date and SimpleDateFormat classes to process time in Java

What are the options for calendar and date libraries in Python?

How to get the millisecond representation of a date using the getTime() method of the Date class

How to solve the problem of springboot configuring date field to return timestamp

How to use Stringbuild, Date and Calendar classes in Java
