From 818005fcb5ca4980ad1bb1cfb56e667007807de1 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Tue, 3 Oct 2023 14:05:44 -0400 Subject: [PATCH] fix(server): fallback to local timezone when rendering storage template (#4317) --- .../src/domain/storage-template/storage-template.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/domain/storage-template/storage-template.service.ts b/server/src/domain/storage-template/storage-template.service.ts index f6265c972e..3ab9694c37 100644 --- a/server/src/domain/storage-template/storage-template.service.ts +++ b/server/src/domain/storage-template/storage-template.service.ts @@ -235,7 +235,9 @@ export class StorageTemplateService { filetypefull: asset.type == AssetType.IMAGE ? 'IMAGE' : 'VIDEO', }; - const dt = luxon.DateTime.fromJSDate(asset.fileCreatedAt, { zone: asset.exifInfo?.timeZone || undefined }); + const systemTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; + const zone = asset.exifInfo?.timeZone || systemTimeZone; + const dt = luxon.DateTime.fromJSDate(asset.fileCreatedAt, { zone }); const dateTokens = [ ...supportedYearTokens,