Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
fix ApproximateCreationDateTime
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
andriiberezhynskyi committed Sep 28, 2017
1 parent cb2fb95 commit 7f795b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7f795b8

Please sign in to comment.