diff --git a/src/main/ipc/paintScaleHandlers/PPG.ts b/src/main/ipc/paintScaleHandlers/PPG.ts index c95ef44..54d46c6 100644 --- a/src/main/ipc/paintScaleHandlers/PPG.ts +++ b/src/main/ipc/paintScaleHandlers/PPG.ts @@ -195,10 +195,15 @@ export async function ppgOutputHandler( }, Transaction: { TransactionID: "", - TransactionDate: new Date() - .toISOString() - .replace("T", " ") - .substring(0, 19), + TransactionDate: (() => { + const now = new Date(); + const year = now.getFullYear(); + const month = ("0" + (now.getMonth() + 1)).slice(-2); + const day = ("0" + now.getDate()).slice(-2); + const hours = ("0" + now.getHours()).slice(-2); + const minutes = ("0" + now.getMinutes()).slice(-2); + return `${year}-${month}-${day}:${hours}:${minutes}`; + })(), }, Product: { Name: "ImEX Online", @@ -251,3 +256,4 @@ export async function ppgOutputHandler( log.error(`Error generating PPG output for config ${config.id}:`, error); } } +