21 lines
426 B
TypeScript
21 lines
426 B
TypeScript
import dayjs from 'dayjs';
|
|
import utc from 'dayjs/plugin/utc';
|
|
|
|
dayjs.extend(utc);
|
|
|
|
function _currentDate() {
|
|
return dayjs().utc(false).hour(5).minute(0).second(0).millisecond(0);
|
|
}
|
|
|
|
export function getCurrentISODate() {
|
|
return _currentDate().toISOString();
|
|
}
|
|
|
|
export function getCurrentDateString() {
|
|
return _currentDate().format('YYYY-MM-DD');
|
|
}
|
|
|
|
export function getCurrentDate() {
|
|
return _currentDate().toDate();
|
|
}
|