salix/loopback/server/boot/date.js

17 lines
366 B
JavaScript
Raw Permalink Normal View History

2023-01-16 14:18:00 +00:00
module.exports = () => {
Date.vnUTC = (env = process.env.NODE_ENV) => {
2023-01-16 14:18:00 +00:00
if (!env || env === 'development')
2023-01-30 14:15:27 +00:00
return new Date(Date.UTC(2001, 0, 1, 11));
2023-01-16 14:18:00 +00:00
return new Date();
2023-01-16 14:18:00 +00:00
};
2023-01-17 14:36:39 +00:00
Date.vnNew = () => {
return new Date(Date.vnUTC());
};
Date.vnNow = () => {
return new Date(Date.vnUTC()).getTime();
};
2023-01-16 14:18:00 +00:00
};