Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IT2810 H21
Team 29
iWhatToWatch
Commits
c23a5231
Commit
c23a5231
authored
Nov 22, 2021
by
Dherik Jenitan Devakumar
Browse files
(
#15
) Commented utils
parent
93521cce
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/util/dateConverter.ts
View file @
c23a5231
/* Converts date object to UNIX date format (seconds after 1970) */
export
function
convertDateToUnixDate
(
date
:
Date
)
{
return
Math
.
round
(
date
.
getTime
()
/
1000
);
}
/* Converts UNIX date format to date object */
export
function
convertUnixDateToDate
(
unixNumber
:
number
)
{
const
date
=
new
Date
(
unixNumber
*
1000
);
return
date
;
}
/* Makes date object readable */
export
function
formatDateAsString
(
date
:
Date
)
{
let
year
=
date
.
getFullYear
();
let
month
=
date
.
getMonth
()
+
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment