Utlimate GPS and dates
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 1
- Joined: Fri Sep 21, 2012 12:35 am
Utlimate GPS and dates
Hello, I'm working on a reverse geocache box using the ultimate GPS but I also wanted to add a time element in addition to location. Specifically, it will only open at at one place on one date (an anniversary). The sample code available on the adafruit guide helps calculate the difference between the current and desired location. I'm having trouble coming up with a function to determine the difference between the current date and the anniversary. Is there any way to convert the GPS.month, and GPS.day to a simple unix-like time stamp that I can then compare with the desired date? How could I factor in leap years and other time weirdness? Anyone had this problem before? Thanks in advance.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Utlimate GPS and dates
What's to convert? If you have GPS.month and GPS.day from the GPS, then you have all you need to match the date:Is there any way to convert the GPS.month, and GPS.day to a simple unix-like time stamp that I can then compare with the desired date?
Code: Select all
if ((GPS.month == Anniversary.month) && (GPS.day == Anniversary.day))
Please be positive and constructive with your questions and comments.