[removed] get month/year/day from unix timestamp

后端 未结 3 1962
半阙折子戏
半阙折子戏 2021-01-01 20:19

I have a unix timestamp, e.g., 1313564400000.00. How do I convert it into Date object and get month/year/day accordingly? The following won\'t work:

function         


        
3条回答
  •  旧巷少年郎
    2021-01-01 20:38

    var date = new Date(1313564400000);
    var month = date.getMonth();
    

    etc.

    This will be in the user's browser's local time.

提交回复
热议问题