Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최은석
/
ossw-project
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-08 01:27:47 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f4afdc18514b140b8039c8d8d7cf6ca351f0deee
f4afdc18
1 parent
5d3dd212
set new date to KST date
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
server/Router/api.js
server/Router/api.js
View file @
f4afdc1
...
...
@@ -35,9 +35,17 @@ const waitingModel = mongoose.model('waiting', waiting);
// res.send({ test: "hi" });
// });
function
getKSTDate
(){
const
curr
=
new
Date
();
const
utc
=
curr
.
getTime
()
+
(
curr
.
getTimezoneOffset
()
*
60
*
1000
);
const
KR_TIME_DIFF
=
9
*
60
*
60
*
1000
;
const
kr_curr
=
new
Date
(
utc
+
(
KR_TIME_DIFF
));
return
kr_curr
;
}
function
getCurrentDate
(
originDate
)
{
var
date
;
if
(
originDate
==
null
)
date
=
new
Date
();
if
(
originDate
==
null
)
date
=
getKST
Date
();
else
date
=
new
Date
(
originDate
);
var
year
=
date
.
getFullYear
().
toString
();
...
...
@@ -51,7 +59,7 @@ function getCurrentDate(originDate) {
}
function
getCurrentTime
()
{
var
date
=
new
Date
();
var
date
=
new
getKST
Date
();
var
hour
=
date
.
getHours
();
hour
=
hour
<
10
?
'0'
+
hour
.
toString
()
:
hour
.
toString
();
...
...
Please
register
or
login
to post a comment