From 7f795b88ec4443b03bdc967a3c5e305eef820144 Mon Sep 17 00:00:00 2001 From: Andrii Berezhynskyi Date: Thu, 28 Sep 2017 12:24:32 +0200 Subject: [PATCH] fix ApproximateCreationDateTime Date.now() returns milliseconds which is interpreted incorectly by boto3. For example boto3 will interprete the ApproximateCreationDateTime as something like `Fri Jan 08 49712 17:18:22`. This crashes boto3 with an error `year is out of range`. We need unix timestamp there (seconds) --- db/streams.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/streams.js b/db/streams.js index 41e09e7..2c2628e 100644 --- a/db/streams.js +++ b/db/streams.js @@ -25,7 +25,7 @@ function createStreamRecord(store, table, oldItem, newItem, cb) { var record = { awsRegion: store.tableDb.awsRegion, dynamodb: { - ApproximateCreationDateTime: Date.now(), + ApproximateCreationDateTime: Math.floor(Date.now() / 1000), Keys: {}, SequenceNumber: key, SizeBytes: 0,