Hi,
I am connecting to a server and it's storing events on it. It's storing the servers date and time to each event.
When I connect to the server I request event 1 and it returns the time & date as well as the event, but the time and date is the servers time & date.
Rather than displaying the servers date & time that event occurred in the app I want to display the users local time & date.
For Example:
The server's current date and time is:
1:30AM Friday, 5 May 2017 (GMT-4)
The server stores an event like:
DDMMYYYYHHMMEVENT
eg. 050520170130Bob logged in
In the example above, it stored the event on 5th of May 2017 at 1:30AM (since this is the servers date and time), and the event is 'Bob logged in'.
Let's say 3 users logged in to get event 1 from the server..
User A current time is: 6:30 am Friday, 5 May 2017 (GMT+1)
User B current time is: 1:30 PM Friday, 5 May 2017 (GMT+8)
User C current time is: 10:30 PM Thursday, 4 May 2017 (GMT-7)
Rather than showing that the event happened at 1:30AM on the 5th of May (the servers time & date it stored the event) I want it to show it happened at:
User A sees the event happened at 6:30 AM Friday, 5 May 2017 (GMT+1)
User B sees the event happened at 1:30 PM Friday, 5 May 2017 (GMT+8)
User C sees the event happened at 10:30 PM Thursday, 4 May 2017 (GMT-7)
Which is the users local time & date.
Any ideas on how to do this ?
(also need it to work during DLS time)
I am connecting to a server and it's storing events on it. It's storing the servers date and time to each event.
When I connect to the server I request event 1 and it returns the time & date as well as the event, but the time and date is the servers time & date.
Rather than displaying the servers date & time that event occurred in the app I want to display the users local time & date.
For Example:
The server's current date and time is:
1:30AM Friday, 5 May 2017 (GMT-4)
The server stores an event like:
DDMMYYYYHHMMEVENT
eg. 050520170130Bob logged in
In the example above, it stored the event on 5th of May 2017 at 1:30AM (since this is the servers date and time), and the event is 'Bob logged in'.
Let's say 3 users logged in to get event 1 from the server..
User A current time is: 6:30 am Friday, 5 May 2017 (GMT+1)
User B current time is: 1:30 PM Friday, 5 May 2017 (GMT+8)
User C current time is: 10:30 PM Thursday, 4 May 2017 (GMT-7)
Rather than showing that the event happened at 1:30AM on the 5th of May (the servers time & date it stored the event) I want it to show it happened at:
User A sees the event happened at 6:30 AM Friday, 5 May 2017 (GMT+1)
User B sees the event happened at 1:30 PM Friday, 5 May 2017 (GMT+8)
User C sees the event happened at 10:30 PM Thursday, 4 May 2017 (GMT-7)
Which is the users local time & date.
Any ideas on how to do this ?
(also need it to work during DLS time)