How to change jquery timestamp to date
The content of this article mainly focuses on how to change the jquery timestamp into a date. The content of the article is clear and well-organized. It is very suitable for beginners to learn and is worth reading. Interested friends can follow the editor to read together. I hope you can get something through this article!
Jquery timestamp into date method: 1, use Date and getTime () method to get the current timestamp, syntax is "new Date (). GetTime ()"; 2, use Date object method to return date format, syntax is "new Date (). GetDate ()".
The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.
How to convert jquery timestamp to date
What is a Unix timestamp (Unix timestamp): a Unix timestamp (Unix timestamp), or Unix time (Unix time), or POSIX time (POSIX time), is a time representation defined as the total number of seconds since 00:00:00 Greenwich time on January 1, 1970. Unix timestamps are widely used not only in Unix systems and Unix-like systems, but also in many other operating systems.
The method to get the current timestamp
Var timestamp1 = Date.parse (new Date ()); var timestamp2 = (new Date ()) .valueOf (); var timestamp3 = new Date () .getTime ()
The first: the timestamp obtained is to change the millisecond to 000 display, and the second and the third is to get the current millisecond timestamp.
Convert the timestamp to a normal date format
Date attribute method
Function add0 (m) {return m