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:17:43 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b0856811b83f1476e17523dd8a38162793acdcd9
b0856811
1 parent
5deb5c15
Fix time set error
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
18 deletions
nodejs/server.js
nodejs/server.js
View file @
b085681
...
...
@@ -32,12 +32,8 @@ app.use(static(__dirname));
// To get today date by using Date
function
getTodayDate
()
{
var
tempDate
=
new
Date
();
console
.
log
(
"[tempDate] "
+
tempDate
);
const
utc
=
tempDate
.
getTime
()
+
tempDate
.
getTimezoneOffset
()
*
60
*
1000
;
const
KR_TIME_DIFF
=
9
*
60
*
60
*
1000
;
const
today
=
new
Date
(
utc
+
KR_TIME_DIFF
);
console
.
log
(
"[today] "
+
today
);
var
today
=
new
Date
();
console
.
log
(
today
);
var
year
=
today
.
getFullYear
();
var
month
=
(
"0"
+
(
today
.
getMonth
()
+
1
)).
slice
(
-
2
);
var
day
=
(
"0"
+
today
.
getDate
()).
slice
(
-
2
);
...
...
@@ -46,13 +42,6 @@ function getTodayDate() {
return
dateString
;
}
function
test
()
{
var
tempDate
=
new
Date
();
// Locale time
const
utc
=
tempDate
.
getTime
()
+
tempDate
.
getTimezoneOffset
()
*
60
*
1000
;
// Calculate UTC time
const
KR_TIME_DIFF
=
9
*
60
*
60
*
1000
;
// UTC to KST (UTC + 9 hours)
return
utc
+
KR_TIME_DIFF
;
}
// To get modified date from locdate
function
getModifiedDate
(
locdate
)
{
return
(
...
...
@@ -214,11 +203,6 @@ app.get("/app", function (req, res) {
);
});
app
.
get
(
"/test"
,
function
(
req
,
res
)
{
init
();
res
.
send
(
Date
()
+
"<br>"
+
Date
(
test
())
+
"<br>"
+
test
());
});
init
();
const
port
=
8080
;
...
...
Please
register
or
login
to post a comment