Commit c23a5231 authored by Dherik Jenitan Devakumar's avatar Dherik Jenitan Devakumar
Browse files

(#15) Commented utils

parent 93521cce
/* 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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment