My server is located in country A and I am getting a UTC timestamp from server in country B. I also receive the timezone offset and daylight savings from that server.
What I need to do is calculate the difference (in seconds) between server A local time and the received timestamp from server B.
My current solution is (implemented on server A) :
long localUTCTimestamp = System.currentTimeMillis() / 1000;
long timeDiff = localUTCTime - serverBUTCTime;
My question is should I take daylight savings in account here ? or is this solution should work regardless.
EDIT:
The time from server B is a timestamp of an event the happened some time ago