i want get date and time that is not from the mobile device

I want to get the date and time that is not from the mobile device. No internet connection. I do not want the date of the mobile device since the user can change the date and time. Can you get the date and time without an Internet connection and not from the mobile device?

Thanks

It’s got to come from somewhere, if it’s not from the device or the internet, I can’t see where else you could get it from.

What is the reason? If it’s to ensure the user isn’t messing with their clock to circumvent time limits or something, you could store the time at random intervals, from the device and internet. If at any point the time is earlier than a time stored previously, you know the user is tampering.

If you want to tamper proof your app’s date and time related functions, you should use a combination of both.

For instance, take the time from a server that you trust and store it locally. Then you use that point to locally track how much time has passed. Once the local clock says that enough time has passed, you check the time from the server again and see if enough time has really passed. This method requires the least amount of bandwidth and works well against tampering. If a user fails to connect to the server, just provide them with a notification to try again later.

If you want to get the current time from the internet I’ve just added the ability in to Puggle

require( "puggle.core" ) local onComplete = function( time ) print( os.date( "%x", time.unix ) ) end puggle.worldtime:now( onComplete )

This also allows you to check info on past/future dates like this:

require( "puggle.core" ) local onComplete = function( time ) print( time.isDayLightSavingsTime ) end puggle.worldtime:get( onComplete, "gmt", "2004-06-12" )

What I do is get the UTC time from my server and then add seconds using an enterFrame().  This stops time changing whilst playing.

I’m not sure how practical this would be as an implementation, but the question intrigued me, so I’ve been thinking…

GPS works separately to a data connection, and relies on knowing where 3 satellites are and the distance you are from them both. It has to do this accurately in order to pin point you on the planet. Thus, it should be theoretically possible to compare GPS data with some kind of pre-coded list of where the GPS satellites were at a specific time, and some kind of a fancy algorithm that factors in their current location, their route of orbit, and that pre-coded list.

If I’m right, then you’d be able to use the GPS satellites current location to fairly accurately figure out the current time.

We seem to all just be throwing ideas around without actually knowing WHY @diego_martinez93  wants to get date and time without the use of Internet or without looking it up from the device. These next level Jedi solutions are cool, but without knowing the why, we can’t even know if this is a relevant question.

So, without any further delays, @diego_martinez93, for what reason do you want to accomplish this? :smiley:

It’s got to come from somewhere, if it’s not from the device or the internet, I can’t see where else you could get it from.

What is the reason? If it’s to ensure the user isn’t messing with their clock to circumvent time limits or something, you could store the time at random intervals, from the device and internet. If at any point the time is earlier than a time stored previously, you know the user is tampering.

If you want to tamper proof your app’s date and time related functions, you should use a combination of both.

For instance, take the time from a server that you trust and store it locally. Then you use that point to locally track how much time has passed. Once the local clock says that enough time has passed, you check the time from the server again and see if enough time has really passed. This method requires the least amount of bandwidth and works well against tampering. If a user fails to connect to the server, just provide them with a notification to try again later.

If you want to get the current time from the internet I’ve just added the ability in to Puggle

require( "puggle.core" ) local onComplete = function( time ) print( os.date( "%x", time.unix ) ) end puggle.worldtime:now( onComplete )

This also allows you to check info on past/future dates like this:

require( "puggle.core" ) local onComplete = function( time ) print( time.isDayLightSavingsTime ) end puggle.worldtime:get( onComplete, "gmt", "2004-06-12" )

What I do is get the UTC time from my server and then add seconds using an enterFrame().  This stops time changing whilst playing.

I’m not sure how practical this would be as an implementation, but the question intrigued me, so I’ve been thinking…

GPS works separately to a data connection, and relies on knowing where 3 satellites are and the distance you are from them both. It has to do this accurately in order to pin point you on the planet. Thus, it should be theoretically possible to compare GPS data with some kind of pre-coded list of where the GPS satellites were at a specific time, and some kind of a fancy algorithm that factors in their current location, their route of orbit, and that pre-coded list.

If I’m right, then you’d be able to use the GPS satellites current location to fairly accurately figure out the current time.

We seem to all just be throwing ideas around without actually knowing WHY @diego_martinez93  wants to get date and time without the use of Internet or without looking it up from the device. These next level Jedi solutions are cool, but without knowing the why, we can’t even know if this is a relevant question.

So, without any further delays, @diego_martinez93, for what reason do you want to accomplish this? :smiley: