1 export function getCurrentDay() {
2 const date = new Date();
3 const month = date.getMonth() + 1;
4 const day = date.getDate();
6 return `${date.getFullYear()}-${(month > 9 ? '' : '0') + month}-${(day > 9 ? '' : '0') + day}`;
9 export function utcTimeStampToLocalTime(timestamp) {
10 const date = new Date(timestamp * 1000);
11 const hours = date.getHours();
12 const mins = date.getMinutes();
13 return `${(hours > 9 ? '' : '0') + hours}:${(mins > 9 ? '' : '0') + mins}`;
16 export function formatDateTime(date) {
17 const month = date.getMonth() + 1;
18 const day = date.getDate();
19 const hours = date.getHours();
20 const mins = date.getMinutes();
22 return `${date.getFullYear()}-${(month > 9 ? '' : '0') + month}-${(day > 9 ? '' : '0') + day} ${(hours > 9 ? '' : '0') + hours}:${(mins > 9 ? '' : '0') + mins}`;