aboutsummaryrefslogtreecommitdiff
path: root/src/lib/util.ts
blob: 8434c86059ab1a6bc7069e096079cdab52ed62ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
export function formatTime(timestamp: number): string
{
    let date = new Date(timestamp*1000);
    let year = date.getFullYear();
    let month = date.getMonth() + 1;
    let day = date.getDate();
    let time = date.toTimeString().split(' ')[0];
    console.log(date.toTimeString());
    let formattedTime = `${time}, ${day}/${month}/${year}`

    return formattedTime;
}