I am building a device that will be used across various time Zones.
My understanding is that the device will get the time from the Handshake with Particle Cloud on my profile, is this correct? If indeed the case, the time will be wrong all of the time is it will never be used in my time zone.
Not sure and external RTC would haver solved the problem as I would need to set the time "dynamically" based on the the location.
The time you get from the Particle cloud will always be UTC as the cloud has no knowledge about the position of your device.
You'd need to get some location info to determine the correct timezone and provide the apropriate time offset.
Hi Friedl,
(happy new year!)
Would it be possible for you to only use UTC time on those devices?
What I mean is this:
if the device does not have a local display or does not show the time to the users, use UTC all the way to the cloud or database (if there is one)
if the device has a display that shows the users the time, well, in this case you want to display the local time, and you need a solution like the one ScruffR proposed.
The device does have a local display but will not necessarily display the time. the problem is that the device will display certain information based on the time of day. We need to log attendance of people attending seminars and as there are multiple sessions each day, the display will show the next event information based on what time is it.
Does this make sense?
Thanks!! Looking forward do doing more Particle projects this year
How do you log the attendance, via the local display or using a website or mobile app?
If using a website or mobile app, maybe you can log the attendance in UTC and get rid of the timezones?
Why all the warnings? Timezones are difficult, and considering local daylight saving times is a pain. So if you can avoid all that pain, the better.
RFID and QR codes. The display is to show the information of the next event scheduled.
We retrieve all the data for the entire day from an end point provided by the client. The device then stores this data and updates the screen as needed. I need the time to determine which event is up next and update the paper display accordingly.
Just a thought, I can ask the client to include the time zone for the specific event in the end point data correct? This I can then use to set the time zone in my application code and make the adjustment from UTC ??
yes, if they can provide the events with a time zone (or in UTC), your particle device does not need to know the time zone it is currently located in, and you save a number of headaches in your code.
I will check with the client. Maybe we can display "Next event in 2 hours" and count down, as apposed to "Next event @ 4pm" In this case we can use UTC.
@friedl_1977 - I agree with @gusgonnet, avoid using local time if at all possible. If it was me, I’d have them provide you the schedule of events in UTC time. I try and capture, record and pass time around as UTC, only at the very last moment do I convert it. In my case, I use JavaScript in the web app. I pass the data to the front end still in UTC and then JavaScript identifies all time on the screen to convert it to local based on the time zone the browser says it is.
In the one instance I can’t do that (sending it out as a SMS message). Then instead of saying last reading was at 10:00 AM, I say the last reading was 5 minutes ago. So even in that scenario, I don’t have to deal with time zone/daylight savings math complexity.