2018-04-01 09:10:12 -04:00
|
|
|
export function getCurrentDay() {
|
2023-04-18 17:20:02 -04:00
|
|
|
const date = new Date();
|
|
|
|
const month = date.getMonth() + 1;
|
|
|
|
const day = date.getDate();
|
2018-04-01 09:10:12 -04:00
|
|
|
|
2023-04-18 17:20:02 -04:00
|
|
|
return `${date.getFullYear()}-${(month > 9 ? '' : '0') + month}-${(day > 9 ? '' : '0') + day}`;
|
2018-04-01 09:10:12 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export function utcTimeStampToLocalTime(timestamp) {
|
2023-04-18 17:20:02 -04:00
|
|
|
const date = new Date(timestamp * 1000);
|
|
|
|
const hours = date.getHours();
|
|
|
|
const mins = date.getMinutes();
|
|
|
|
return `${(hours > 9 ? '' : '0') + hours}:${(mins > 9 ? '' : '0') + mins}`;
|
2018-06-30 00:58:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export function formatDateTime(date) {
|
2023-04-18 17:20:02 -04:00
|
|
|
const month = date.getMonth() + 1;
|
|
|
|
const day = date.getDate();
|
|
|
|
const hours = date.getHours();
|
|
|
|
const mins = date.getMinutes();
|
2018-06-30 00:58:11 -04:00
|
|
|
|
2023-04-18 17:20:02 -04:00
|
|
|
return `${date.getFullYear()}-${(month > 9 ? '' : '0') + month}-${(day > 9 ? '' : '0') + day} ${(hours > 9 ? '' : '0') + hours}:${(mins > 9 ? '' : '0') + mins}`;
|
|
|
|
}
|