DynamoDbAutoGeneratedTimestampAttribute custom date format and time zone #5062
Labels
dynamodb-enhanced
feature-request
A feature should be added or improved.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Describe the feature
The
@DynamoDbAutoGeneratedTimestampAttribute
annotation allows anInstant
to be stored in DynamoDB as a String, however, the format of this string is fixed to (e.g.)2023-06-06T18:16:40.632760903Z
.I have a requirement to store the date in a different format e.g.
2023-06-06T18:16:40+01:00
.Use Case
I have tried the following:
However
@DynamoDbAutoGeneratedTimestampAttribute
requires the method to return anInstant
, leaving no easy way of specifying the format of the auto generated time.Proposed Solution
A nice way to achieve this would be to allow the annotation user to specify a format and time zone e.g.
@DynamoDbAutoGeneratedTimestampAttribute(format=DateTimeFormatter.ISO_OFFSET_DATE_TIME, timezone="Europe/London")
Other Information
No response
Acknowledgements
AWS Java SDK version used
2.25.23
JDK version used
21.0.1
Operating System and version
N/A
The text was updated successfully, but these errors were encountered: