Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
196 views
in Technique[技术] by (71.8m points)

swift - Is there any way to have Date time other than using Date() ios

Hello I am working on an ios app and I need to have a reliable source of truth other than the phone date time settings (witch the user can change by himself).

It is for a situation where I do not have internet and need to timestamp an event.

I so far I tried getting timestamp from CoreLocation object -> It does takes the timeStamp of the phone.

and look in CallKit or CoreTelephony if I could get any information about the time of the cellular provider network (in case we do not have internent but are still connected to cellular networl).

Is it me or I will be forced to timestamp with whatever date I do have at the time of the event and then when internet comes back, computes the offset from my backoffice time ?

thanks

question from:https://stackoverflow.com/questions/66066194/is-there-any-way-to-have-date-time-other-than-using-date-ios

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Closing the discution. It seems that the anwser is No, there is no way to get cellular time or gps time, we do need to compute the delay based on a NTP server (or backoffice server) when we get internet back


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...