From 31d9b71d35bda0659ab372878c2956194a09f5f3 Mon Sep 17 00:00:00 2001 From: John Gilbert Date: Sat, 21 Sep 2024 14:32:37 -0400 Subject: [PATCH] utc --- src/sinks/claimcheck.js | 2 +- test/unit/sinks/claimcheck.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sinks/claimcheck.js b/src/sinks/claimcheck.js index f5e3600..6ea5cc9 100644 --- a/src/sinks/claimcheck.js +++ b/src/sinks/claimcheck.js @@ -9,7 +9,7 @@ import { now } from '../utils/time'; const formatKey = (event) => { const d = new Date(now()); // region/claimchecks/YYYY/MM/DD/HH/id - return `${process.env.AWS_REGION}/claimchecks/${d.getFullYear()}/${d.getMonth()}/${d.getDate()}/${d.getHours()}/${event.id}`; + return `${process.env.AWS_REGION}/claimchecks/${d.getUTCFullYear()}/${d.getUTCMonth()}/${d.getUTCDate()}/${d.getUTCHours()}/${event.id}`; }; export const toClaimcheckEvent = (event, bucket) => ({ diff --git a/test/unit/sinks/claimcheck.test.js b/test/unit/sinks/claimcheck.test.js index 81b303c..4e16709 100644 --- a/test/unit/sinks/claimcheck.test.js +++ b/test/unit/sinks/claimcheck.test.js @@ -59,12 +59,12 @@ describe('sinks/claimcheck.js', () => { tags: undefined, s3: { bucket: 'event-lake-s3', - key: 'us-west-2/claimchecks/2024/8/20/13/3', + key: 'us-west-2/claimchecks/2024/8/20/17/3', }, }, putClaimcheckRequest: { Bucket: 'event-lake-s3', - Key: 'us-west-2/claimchecks/2024/8/20/13/3', + Key: 'us-west-2/claimchecks/2024/8/20/17/3', Body: '{\"id\":\"3\",\"body\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}', }, },