- Introduced
- Specific introduction
Introduced
This article describes the use of the date of PHP and JS.
Specific introduction
Today's difficulty is the date output 24-hour time, for this weak link, make a simple note.
PHP Date ()
PHP date () output 24-hour time method:echo date("Y-m-d H:i:s");
Method for outputting 12-hour Time:echo date("y-m-d h:i:s");
The main difference between uppercase and lowercase is that integrity, for example, H
h
corresponds to a 24/12-hour system.
The following code:
echo date("Y-m-d H:i:s")."
";echo date("y-m-d h:i:s");
The output to the browser is:
2014-03-01 14:09:1514-03-01 02:09:15
JS Date ()
The JS object for processing time, including a variety of processing time methods, simple.
Code blocks for common methods:
//①:document.write(Date())var d=newDate()var day=d.getDate()var1//注:该方法返回0~11var year=d.getFullYear()//②"/""/" + day)
The result block corresponding to the output (please check the number of rows, so as to facilitate reading):
①:Fri May 13 2016 18:55:34 GMT+0800 (中国标准时间)②:2016/4/13
Resources
PHP date () output 24-hour or 12-hour system
JavaScript Date Object-The
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the basic level-Date of PHP && JS, including the date,php aspect of the content, I hope to be interested in PHP tutorial friends helpful.