$INCLUDE "windowssdk.inc" TYPE DateType UINT LowDW UINT HighDW ENDTYPE UNION uDT UINT64 qVar DateType dtVar ENDUNION uDT u SYSTEMTIME st FILETIME ft INT rtn UINT64 qDAY = 24*60*60*10000000 '1 day in nano seconds ISTRING tomorrow[11] 'First get the system time so that all the other structure members are filled GetSystemTime(st) 'Set up the SYSTEMTIME structure with the original date like so: ' st.wDay = 30 ' st.wMonth = 11 ' st.wYear = 2023 PRINT PRINT USING("Original Date = ##/##/####",st.wDay,st.wMonth,st.wYear) ' Convert the system time to file time rtn = SystemTimeToFileTime(st,ft) ' Move the FILETIME info into a UINT64 variable ' and add days using the Quad variable (this is how M$ recommends doing it) u.dtVar.LowDW = ft.dwLowDateTime u.dtVar.HighDW = ft.dwHighDateTime 'Add days using the Quad variable. u.qVar += (qDAY * 1) 'Add 1 day ft.dwLowDateTime = u.dtVar.LowDW ft.dwHighDateTime = u.dtVar.HighDW ' Convert the file time to system time rtn = FileTimeToSystemTime(ft,st) ' Now your new date will be in the SYSTEMTIME structure members PRINT PRINT "One day added" PRINT USING("##/##/####",st.wDay,st.wMonth,st.wYear) print print "One day added returned by 'tomorrow'" tomorrow=STR$(st.wDay)+"/"+STR$(st.wMonth)+"/"+STR$(st.wYear) tomorrow=fixDate() PRINT tomorrow PRINT PRINT "Press any key..." DO:UNTIL INKEY$<>"" CLOSECONSOLE END SUB fixDate(),STRING RETURN USING("##/##/####",st.wDay,st.wMonth,st.wYear) ENDSUB