mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 05:38:03 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/** @internal */
|
||||
function zeroPad(value) {
|
||||
return value.toString().padStart(2, '0');
|
||||
}
|
||||
/**
|
||||
* @name formatDate
|
||||
* @description Formats a date in CCYY-MM-DD HH:MM:SS format
|
||||
*/
|
||||
export function formatDate(date) {
|
||||
const year = date.getFullYear().toString();
|
||||
const month = zeroPad((date.getMonth() + 1));
|
||||
const day = zeroPad(date.getDate());
|
||||
const hour = zeroPad(date.getHours());
|
||||
const minute = zeroPad(date.getMinutes());
|
||||
const second = zeroPad(date.getSeconds());
|
||||
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
||||
}
|
||||
Reference in New Issue
Block a user