@tencentcloud/ai-desk-customer-vue
Version:
Vue UIKit for AI Desk
16 lines (11 loc) • 343 B
JavaScript
// user system clock may be inaccurate, so we need to adjust the timestamp
// based on the baseTime received from login server
let _offset = 0;
export const getTimestamp = function() {
return new Date().getTime() + _offset;
};
export const getDate = function() {
const now = new Date();
now.setTime(getTimestamp());
return now;
};