LoginSignup
0
0

More than 3 years have passed since last update.

JavaScript(日付)

Posted at

JavaScript日付取得一覧

js
var dt = new Date();

//
var year = dt.getFullYear();

//
var month = dt.getMonth()+1;

//
var date = dt.getDate();

//曜日
dateT = ["日","月","火","水","木","金","土"];
var day = dateT[dt.getDay()];

//
var hours = dt.getHours();

//
var minutes = dt.getMinutes();

//
var seconds = dt.getSeconds();

参考資料: https://www.sejuku.net/blog/22867

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0