[LND] Nullify zeroed timestamps

This commit is contained in:
nymkappa
2023-02-13 14:23:32 +09:00
parent b7e6b6da13
commit 6d1e6a92ad
6 changed files with 30 additions and 6 deletions

View File

@@ -237,7 +237,10 @@ export class Common {
].join('x');
}
static utcDateToMysql(date?: number): string {
static utcDateToMysql(date?: number | null): string | null {
if (date === null) {
return null;
}
const d = new Date((date || 0) * 1000);
return d.toISOString().split('T')[0] + ' ' + d.toTimeString().split(' ')[0];
}