round the time

This commit is contained in:
fyears 2024-01-13 21:20:56 +08:00
parent c5e3147805
commit 8bb095c4aa

View File

@ -544,8 +544,8 @@ export const uploadToRemote = async (
let ctime = 0; let ctime = 0;
const s = await vault.adapter.stat(fileOrFolderPath); const s = await vault.adapter.stat(fileOrFolderPath);
if (s !== null) { if (s !== null) {
mtime = s.mtime; mtime = Math.round(s.mtime / 1000.0) * 1000;
ctime = s.ctime; ctime = Math.round(s.ctime / 1000.0) * 1000;
} }
const mtimeStr = new Date(mtime).toISOString().replace(/\.\d{3}Z$/, "Z"); const mtimeStr = new Date(mtime).toISOString().replace(/\.\d{3}Z$/, "Z");