Created
January 30, 2020 13:45
-
-
Save motsu0/962ffb2d7e50c921bb2a1d2a6dcd6da7 to your computer and use it in GitHub Desktop.
Date object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const date = new Date(); //現在の日時よりDateオブジェクトを生成 | |
const yyyy = date.getFullYear(); //年 | |
const MM = date.getMonth()+1; //月 | |
const dd = date.getDate(); //日 | |
const hh = date.getHours(); //時 | |
const mm = date.getMinutes(); //分 | |
const dow_list = ['日','月','火','水','木','金','土']; | |
const dow = dow_list[date.getDay()]; //曜日 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment