Skip to content

Commit 90f6f27

Browse files
committed
better naming in utcToLocalTimeZone()
1 parent 8160bc3 commit 90f6f27

File tree

1 file changed

+3
-3
lines changed
  • packages/cubejs-backend-shared/src

1 file changed

+3
-3
lines changed

packages/cubejs-backend-shared/src/time.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ export const utcToLocalTimeZone = (timezone: string, timestampFormat: string, ti
236236
const parsedTime = Date.parse(`${timestamp}Z`);
237237
// TODO parsedTime might be incorrect offset for conversion
238238
const offset = zone.utcOffset(parsedTime);
239-
const inDbTimeZoneDate = new Date(parsedTime - offset * 60 * 1000);
239+
const localTimeZoneDate = new Date(parsedTime - offset * 60 * 1000);
240240
if (timestampFormat === 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' || timestampFormat === 'YYYY-MM-DDTHH:mm:ss.SSSZ') {
241-
return inDbTimeZoneDate.toJSON();
241+
return localTimeZoneDate.toJSON();
242242
} else if (timestampFormat === 'YYYY-MM-DDTHH:mm:ss.SSS') {
243-
return inDbTimeZoneDate.toJSON().replace('Z', '');
243+
return localTimeZoneDate.toJSON().replace('Z', '');
244244
}
245245
}
246246

0 commit comments

Comments
 (0)