15.日付
1234 ワード
「RunningJavaScript」を見て学んだ内容です。
✔JavaScriptの日時は、内蔵のDateオブジェクトが担当します.
Dateオブジェクトは最初にJavaからインポートされました.
(「java」スクリプトはjavaに関連する数少ない部分の1つです)
現在の日時を表すオブジェクトを作成する場合はnew Date()を使用します.
名前の日付
✔JavaScriptの日時は、内蔵のDateオブジェクトが担当します.
Dateオブジェクトは最初にJavaからインポートされました.
(「java」スクリプトはjavaに関連する数少ない部分の1つです)
現在の日時を表すオブジェクトを作成する場合はnew Date()を使用します.
const now = new Date();
now; // Fri Dec 16 2020 09:20:16 GMT +0900 (KST)
特定の日付のオブジェクトを作成する場合:const halloween = new Date(2020, 9, 31); // 월은 0에서 시작. 9 ➜ 10.
特定の日時のオブジェクトを作成する場合:const halloweenParty = new Date(2020, 9, 31, 19, 0); // 19:00 = 7:00 pm
日付オブジェクトを作成すると、次のセクションをインポートできます.halloweenParty.getFullYear(); // 2021
halloweenParty.getMonth(); // 5
halloweenParty.getDate(); // 8
halloweenParty.getDay(); // 2 (1: 월요일, 0: 일요일)
halloweenParty.getHours(); // 12
halloweenParty.getMinutes(); // 0
halloweenParty.getSeconds(); // 0
halloweenParty.getMillisecounds(); // 0
Reference
この問題について(15.日付), 我々は、より多くの情報をここで見つけました https://velog.io/@yoojiwon/15.-날짜テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol