Check if date is set automatically

Is there a way to check if date/ Time is set automatically on the device? I have an app that has to guarantee that the date & time are correct. When the user is online I call a REST API to get the current time but if they are in airplane mode I need to get the time from the device. The requirements are that if date/time isn’t set automatically on the device we shouldn’t allow the user to continue.

This doesn’t make any sense to me. Even if you could figure this out, I don’t see how you could guarantee that the date and time is anywhere near accurate if the device is offline. I think the best you could do is to have all requests contain what time the device thinks it is now, and then compare it to what the server thinks and either compensate or ignore the request. Still, you wouldn’t really have a guarantee of anything, because the device owner could spoof anything at any time.

You are right that it’s not a 100% guarantee but spoofing requests/data requires someone to be tech savy. The user base that we have we don’t expect to be tech savy but I think anyone that has a phone/tablet knows how to manually change the date/time on the device. Our goal isn’t to prevent the .01 percent chance that someone spoofed a request it’s more the common scenario that someone set their time incorrectly.

Regardless of if the requirements are good or not, the question still remains. Is there a way to check if the date & time are set automatically on the device?

Again, how is this a more useful thing to check than having the device send its notion of the current time with all requests, so that the server can compensate for skew?

Users have the option of creating a “document” offline and could submit it whenever they want. We are trying to make a best effort to see when the “document” was created. Especially since the document needs multiple signatures and we need to record when it was signed

This doesn’t answer my question at all. I’m envisioning a scenario whereby the device timestamps the document creation using whatever its clock says, and then when the device comes online, it submits both the document and what time the device thinks it is now. The server takes that, compares it to what time the server thinks it is now, and uses that to either compensate for any time skew or reject the request if the skew is too great. In what way is this less useful than a hypothetical “way to check if the date & time are set automatically on the device”?

First of all thanks for taking the time to respond to my queries. Anyone that takes the time to respond on a forum should be applauded, so thank you

Second, in regards to this issue. It sounds like there is no way to detect if the date/time is set automatically in Ionic, otherwise I’m assuming you would have told me how to implement it.

Third, your suggestion is a good one and I might have to use it but it has 1major flaw that I’ll just have to live with. Users need to submit their documents by clicking on a submit button. As per the requirements we are allowing the users to submit their documents up to 2 weeks after they were created. The issue with your suggestion is that if we check timestamp 2 weeks later it doesn’t in any way tell us that the time when the document was created was accurate

One possible way to mitigate that is to use the network information plugin to send the device’s timestamp as soon as the network is reconnected. That’s about as close to “when the document was timestamped” as I can think of getting. Then you can look back once the document is submitted to find the most contemporaneous skew information available.