Skip to content

Commit 641d6cf

Browse files
committed
return back utcToLocalTimeZone
1 parent 2a1152e commit 641d6cf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export const inDbTimeZone = (timezone: string, timestampFormat: string, timestam
233233
/**
234234
* Takes timestamp in UTC, treat it as local time in provided timezone and returns the corresponding timestamp in UTC
235235
*/
236-
export const utcToLocalTimeZoneInUtc = (timezone: string, timestampFormat: string, timestamp: string): string | null => {
236+
export const utcToLocalTimeZone = (timezone: string, timestampFormat: string, timestamp: string): string | null => {
237237
if (!timestamp) {
238238
return null;
239239
}

packages/cubejs-query-orchestrator/src/orchestrator/PreAggregationPartitionRangeLoader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import {
66
TO_PARTITION_RANGE,
77
MAX_SOURCE_ROW_LIMIT,
88
reformatInIsoLocal,
9-
utcToLocalTimeZoneInUtc,
9+
utcToLocalTimeZone,
1010
timeSeries,
1111
inDbTimeZone,
12-
extractDate
12+
extractDate,
1313
} from '@cubejs-backend/shared';
1414
import { InlineTable, TableStructure } from '@cubejs-backend/base-driver';
1515
import { DriverFactory } from './DriverFactory';
@@ -442,7 +442,7 @@ export class PreAggregationPartitionRangeLoader {
442442
}
443443

444444
private now() {
445-
return inDbTimeZone(this.preAggregation.timezone, 'YYYY-MM-DDTHH:mm:ss.SSS', new Date().toJSON().substring(0, 23));
445+
return utcToLocalTimeZone(this.preAggregation.timezone, 'YYYY-MM-DDTHH:mm:ss.SSS', new Date().toJSON().substring(0, 23));
446446
}
447447

448448
private orNowIfEmpty(dateRange: QueryDateRange): QueryDateRange {

0 commit comments

Comments
 (0)