Toggle navigation
Toggle navigation
This project
Loading...
Sign in
teamPARK
/
holiday-counter-recommend-activity
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박지환
2022-06-07 11:27:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e99e62a100eed60b1b329f4faf0b8fd582c19bc0
e99e62a1
1 parent
b0856811
Test time set
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
nodejs/server.js
nodejs/server.js
View file @
e99e62a
...
...
@@ -32,12 +32,24 @@ app.use(static(__dirname));
// To get today date by using Date
function
getTodayDate
()
{
var
today
=
new
Date
();
console
.
log
(
today
);
const
tempDate
=
new
Date
();
console
.
log
(
tempDate
.
getTimezoneOffset
());
const
utc
=
tempDate
.
getTime
()
+
tempDate
.
getTimezoneOffset
()
*
60
*
1000
;
const
KR_TIME_DIFF
=
9
*
60
*
60
*
1000
;
const
today
=
new
Date
(
utc
+
KR_TIME_DIFF
);
var
year
=
today
.
getFullYear
();
var
month
=
(
"0"
+
(
today
.
getMonth
()
+
1
)).
slice
(
-
2
);
var
day
=
(
"0"
+
today
.
getDate
()).
slice
(
-
2
);
var
dateString
=
year
+
"-"
+
month
+
"-"
+
day
;
console
.
log
(
dateString
+
"-"
+
today
.
getHours
()
+
"-"
+
today
.
getMinutes
()
+
"-"
+
today
.
getSeconds
()
);
// return "2022-12-25"; // 테스트용 날짜를 입력하세요. *** 테스트가 끝나면 주석처리하고 커밋해주세요. *** ex) 2022-09-12, 2022-09-15, 2022-10-04
return
dateString
;
}
...
...
Please
register
or
login
to post a comment