On server I use protobuf (google.protobuf.Int64Value start/end), convert DateTime value from database to timestamp(in milliseconds) with mapper and send to client.
Оn client i use moment to convert timestamps to start/end dates and display dates on screen
In base:
start - 2022-07-10 00:00:00.0000000
end - 2022-07-20 23:59:59.9990000
Timestamps:
start - 1657400400000
end - 1658350799999
Moments on client:
start - Sun Jul 10 2022 00:00:00 GMT+0300
end - Wed Jul 20 2022 23:59:59 GMT+0300
Display in event list
7/10/22 - 7/20/22
Moments on client:
start - Sun Jul 10 2022 06:00:00 GMT+0900
end - Thu Jul 21 2022 05:59:59 GMT+0900
Display in event list
7/10/22 - 7/21/22
How can this problem be solved? I should see the same event start/end time no matter what timezone the server or client is in.