mirror of
https://github.com/knex/knex.git
synced 2025-07-03 07:04:07 +00:00
15 lines
416 B
JavaScript
15 lines
416 B
JavaScript
function yyyymmddhhmmss() {
|
|
const now = new Date();
|
|
|
|
return (
|
|
now.getUTCFullYear().toString() +
|
|
(now.getUTCMonth() + 1).toString().padStart(2, '0') +
|
|
now.getUTCDate().toString().padStart(2, '0') +
|
|
now.getUTCHours().toString().padStart(2, '0') +
|
|
now.getUTCMinutes().toString().padStart(2, '0') +
|
|
now.getUTCSeconds().toString().padStart(2, '0')
|
|
);
|
|
}
|
|
|
|
module.exports = { yyyymmddhhmmss };
|