I can't figure out how to handle the timezone efficiently with dynamodb get operation.
Say my partition primary key and range key (sk) are below, where each record is aggregated data for the whole day done by the user. 2022-09-13 00:00:00 to 2022-09-13 23:23:59
{
pk: 'userId',
sk: '2022-09-13'
}
What is the best approach to store the dates as UTC and fetch based on the client's timezone?
In the current behavior of my program, I'm saving the range key (sk) as UTC date. But if the client's local timezone is +8:00, and when he performs a save operation at 2022-09-14 00:01:00, it will still be stored in the 2022-09-13
.