Skip to content

dynamodbstreams: ApproximateCreationDateTime returns datetime.datetime Instead of timestamp #8042

Closed Answered by bblommers
RajasGujarathi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @RajasGujarathi! The HTTP API will indeed send a ISO-8601 string, but boto3 will automatically convert that into a datetime object.
See the boto3-specific API here: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodbstreams/client/get_records.html

For background information: Moto actually returns the date in ISO format as well, because we only intercept/mock the actual HTTP response. boto3 still converts the Moto response into a datetime object, like it would do with an actual AWS response.

"CreationRequestDateTime": table.stream_shard.created_on.isoformat(), # type: ignore[union-attr]

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RajasGujarathi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants