質問編集履歴
1
質問の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
JavaScriptで現在時間と日付と、1
|
5
|
+
JavaScriptで現在時間と日付と、1日後の時間と日付を表示したいと考えています。
|
6
6
|
|
7
7
|
|
8
8
|
|
@@ -14,28 +14,30 @@
|
|
14
14
|
|
15
15
|
const now = new Date()
|
16
16
|
|
17
|
-
const one
|
17
|
+
const onedaylater = now.setDate(now.getDate() + 1);
|
18
|
+
|
19
|
+
const newdate = new Date(onedaylater)
|
18
20
|
|
19
21
|
console.log(now)
|
20
22
|
|
21
|
-
console.log(
|
23
|
+
console.log(newdate)
|
22
24
|
|
23
25
|
```
|
24
26
|
|
25
27
|
|
26
28
|
|
27
|
-
ですがconsoleでは下記のような出力になり
|
29
|
+
ですがconsoleでは下記のような出力になり1日後の時間と日付が取得できません。
|
28
30
|
|
29
31
|
```
|
30
32
|
|
31
|
-
|
33
|
+
Wed Apr 24 2019 16:15:22 GMT+0900 (日本標準時)
|
32
34
|
|
33
|
-
4
|
35
|
+
Wed Apr 24 2019 16:15:22 GMT+0900 (日本標準時)
|
34
36
|
|
35
37
|
```
|
36
38
|
|
37
39
|
|
38
40
|
|
39
|
-
|
41
|
+
1日後の時間と日付を表示するため、何かアドバイスをいただけたら幸いです。
|
40
42
|
|
41
43
|
よろしくお願いいたします。
|