+Tequila Posted March 16, 2009 Share Posted March 16, 2009 This is kinda funny. I have a cartridge that has a time check designed to prevent playing it in daylight. I check the time and if it is before 9 p.m. it won't run. A friend got around this by changing the time zone on her GPS till she got a time zone where it was after 9 p.m. I have to admire her creativity but am curious if anyone has a suggestion on how to prevent this. T Quote Link to comment
matejcik Posted March 16, 2009 Share Posted March 16, 2009 well :e)) how do you retrieve the date? via os.date() function? it should be possible to use "!" at the start of the format string and get UTC time instead of the timezoned one. then it's a matter of simple math: i assume you know what is the proper timezone for your cartridge :e) so just add the proper number of hours. or do the calculation beforehand and compare UTC time to some known value that corresponds to 9pm your time. Quote Link to comment
+Tequila Posted March 16, 2009 Author Share Posted March 16, 2009 I love this forum. No challenge goes unmet. Quote Link to comment
+Tequila Posted March 16, 2009 Author Share Posted March 16, 2009 Here is the code I am using. t=os.date('*t') start_time_hour=t.hour Where do I place the ! to get UTC instead of local time? Thx. Quote Link to comment
stepping stone Posted September 22, 2009 Share Posted September 22, 2009 well :e)) how do you retrieve the date? via os.date() function? it should be possible to use "!" at the start of the format string and get UTC time instead of the timezoned one. then it's a matter of simple math: i assume you know what is the proper timezone for your cartridge :e) so just add the proper number of hours. or do the calculation beforehand and compare UTC time to some known value that corresponds to 9pm your time. But you still can change your clock to another hour, or can't we ? Quote Link to comment
matejcik Posted September 23, 2009 Share Posted September 23, 2009 you probably can, but i'm not completely sure. it is possible that the player is taking time info from GPS. probably not, but it's possible. i want to implement that for openWIG at some point Quote Link to comment
+sTeamTraen Posted September 23, 2009 Share Posted September 23, 2009 I would guess that the PocketPC player probably takes its time from the OS. The Garmin players have no other possible time source than the GPS. Quote Link to comment
Ranger Fox Posted September 24, 2009 Share Posted September 24, 2009 I would guess that the PocketPC player probably takes its time from the OS. The Garmin players have no other possible time source than the GPS. However, I can set the time zone on my GPSr. Its time does not update automatically as I fly across time zones. Remember, the GPS broadcasts its time in UTC, not by time zone. I think the Wherigo Player would receive this user-augmented time and not the UTC time broadcast by the GPS. If you want the cartridge to do something only after 9PM, I can still visit the site on my lunch break and tell my GPSr I'm on the other side of the world. Quote Link to comment
+Tequila Posted September 24, 2009 Author Share Posted September 24, 2009 I would guess that the PocketPC player probably takes its time from the OS. The Garmin players have no other possible time source than the GPS. However, I can set the time zone on my GPSr. Its time does not update automatically as I fly across time zones. Remember, the GPS broadcasts its time in UTC, not by time zone. I think the Wherigo Player would receive this user-augmented time and not the UTC time broadcast by the GPS. If you want the cartridge to do something only after 9PM, I can still visit the site on my lunch break and tell my GPSr I'm on the other side of the world. I got around this by using GMT as the time check. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.