FIRMWARE: 4.7B30

What time is it? ...

If you have a external real time clock, these basic time/date algorithms might help. 
All algorithms needs polishing and code reduction. Works in our applications. 
All files are "as is" - make sure you double check by testing them!

Day of week (DOW) from RTC date$ - File "DOW_R1.BAS"

Leap Year from date(yyyy) - File "LEAP_YR1.BAS"
Array is generated from the number days in month from "data".
Then it uses leap year for the number of days in February.
A complete calendar of the "number of days" for the given month (1-12)
is generated.

Daylight saving time (DST) from day of week and RTC date. File - "DST_R1.BAS"
Returns a true flag "1" if the RTC date is in DST otherwise false "0"
DST algorithm needs modified for other time zones and countries (not EST/EDT).
Using the DST flag, a user could automatically spring forward or fall back his
RTC time in his embedded micro controller. You will need to monitor this flag
every second (from the RTC) for you to automatically change the Micromite time
during DST change over times at 2 AM. Better yet, just use Settick interrupt daily. Be sure to 
prevent numerous updates by using a special "save var" lockout flag. Unlock this flag on the next day. 

Another use is to use this DST flag to generate a DST date(s) file on the SD card memory for the MM+ Explore 64. 
Then on daily reset/bootup - change the time automatically if "today" is DST. Use the special MM+ "library" flash section on bootup.
This utility program (File - "Utly5.bas") automatically generates 10 years DST dates (adjustable to 100 years +) in a SD memory file ("Dstdates.dat")         
We use this file "LIB_DST" in the Library flash section to read the DST dates ("Dstdates.dat") from SD memory on bootup and change the RTC time on 
our MM+ Explore 64 Embedded BASIC Laptop. Additional files generated ... "DST_STAT.DAT" True/flase DST lockout and "DST_Log.DAT"

For those MicroMite users that has a external RTC attached to a MicroMite and a fixed time zone due to NO DST you are so lucky!

Geoff Graham created a GPS Clock Project. We patched his software so it would update our MM+ Explore 64 DS3231 RTC.
You would need a GPS on com2. File "Utly1.bas" compares the GPS time/date with the time/date of the DS3231. No RTC dates/times
are updated but the times and dates of both clock sources are shown. Use this file to double check both clock sources before updating. 
File "Utly5.bas" will automatically, with a beep and no printing, update the external DS3231 RTC with the GPS time/date.
The time difference is +- 1 second. Note: You need to remove the auto time zone change due to the automatic DST algorithm if
you don't have daylight saving time.

We use all the above algorithms to keep our DS3231 RTC on our MM+ Explore 64 Embedded Basic Laptop with precision time without
a network connection. Of course, manually using RTC Settime is an easy way out.        

Enjoy ...
 