Re: How do I discern Maidenhead Locator from GPS lat long info.
if your time offset from utc is 3.00 hours then the minutes and seconds are irrelevant.
after adding your offset then you need to check if the new hours is >23
if so then add a day to the date then test if that is greater
than the number of days for that month [ don't forget leap years / leap centuries],
then increment the month if there are too many days
you may even need to increment the year , not forgetting to set the new day/month to the appropriate value after all
the incrementing and the new hour to modulo 24
better still get a raspberry pi use python datetime
now=datetime.datetime.utcnow()+datetime.timedelta( hours=3)
and it does everything in one line
Last edited by richard; - 26th May 2018 at 16:24.
Reason: fixed datetime
Warning I'm not a teacher
Bookmarks