This article is mainly to JS in the time conversion-millisecond conversion to date time of the sample code is introduced, need friends can come to the reference, I hope to help you
The JS millisecond time is converted to the date time code as follows: var oldtime = (New Date ("2011/11/11 20:10:10")). GetTime (); Get the number of milliseconds is mostly in milliseconds divided by 365*24*60*60&1000, so turn back, this method conversion is too complex, month, time and seconds are to be different methods to obtain, and some years have 366 days, some 365 days, so it is too complicated. After you tried a method, incredibly successful the code is as follows: var oldtime = (New Date ("2011/11/11 20:10:10")). GetTime (); Gets the millisecond number var newtime = new Date (oldtime); You get the normal time. Direct incoming milliseconds as an argument, giving the date object the usual time, and then getting the date by gethours,getfullyear and so on.