Date/time issue with different zone

1027 views java
9

Spring boot application i set globally time zone UTC. so that client (Angular) they are displaying based on user time zone that is correct working. But the problem is we are searching the record based on changed date. How to solve that issue?

Example:

  1. create one record(submission date) in db that is UTC suppose 30/10/2018 : 7:30:45
  2. now i return the response to client that date is(submission) 30/10/2018 then after in anguar.js app they are converting based on user time zone just assume in US time Zone it will display (submission date)29/10/2018 ,
  3. So how can I solved that issue when user search the record based on submission date (29/10/2018)
  4. in DB actual date is 30/10/2018 but in client app they are searching based on client date 29/10/2018

answered question

1 Answer

6

It is their(Front-end developer's) responsibility to send UTC date to server and server will return the results based on UTC only and then they can convert dates in user's timezone.

So the conclusion is the server will be handling only one timezone which is UTC.

Ask angular developer to convert the date into UTC and send it to server.

posted this

Have an answer?

JD

Please login first before posting an answer.