javascript - Is there a function in jq that converts timestamp to date? It is not the kind written by myself, it is jq itself.
迷茫
迷茫 2017-05-19 10:37:39
0
5
641

Asking a very simple question, is there a function in jq that converts timestamps into dates? It is not the kind I wrote myself, it is encapsulated by jq itself.

If not, I will convert it directly in php, but I still want to know if there is

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(5)
Peter_Zhu
new Date(1492572314659).toLocaleDateString()

"2017/4/19"
巴扎黑

It seems there is none. It’s all handled by myself

大家讲道理

js itself has new Date (timestamp), which creates a new date object in js. This object has getDate, getMonth, getFullYear and other methods to get the year, month and day. Please refer to the document for details: https://developer.mozilla.org ...

Note that the timestamp of js is in milliseconds

Peter_Zhu

I deliberately searched the jquery source code. I did not get the date format function directly. I need to manually combine it. jq added a $.now() to get the timestamp.

小葫芦

jQuery-ui has a dataPicker plug-in to obtain time and configure the time output format

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template