CAL.HIJRI = 6 global CAL.HIJRI struct SYSTEMTIME, wYear as word, wMonth as word, _ wDayOfWeek as word, wDay as word, wHour as word, _ wMinute as word, wSecond as word, wMilliseconds as word struct CALDATETIME, CalId as long, Era as long, _ Year as long, Month as long, Day as long, DayOfWeek as long, _ Hour as long, Minute as long, Second as long, Tick as long calldll #kernel32, "GetSystemTime", SYSTEMTIME as struct, _ result as long calldll #kernel32, "ConvertSystemTimeToCalDateTime", _ SYSTEMTIME as struct, CAL.HIJRI as long, _ CALDATETIME as struct, result as long print "Today's date in the Hijri calendar is:" print "Year "; CALDATETIME.Year.struct;", "; print "Month "; CALDATETIME.Month.struct;", "; print "Day "; CALDATETIME.Day.struct
CAL.HIJRI = 6 global CAL.HIJRI struct SYSTEMTIME, wYear as word, wMonth as word, _ wDayOfWeek as word, wDay as word, wHour as word, _ wMinute as word, wSecond as word, wMilliseconds as word struct CALDATETIME, CalId as long, Era as long, _ Year as long, Month as long, Day as long, DayOfWeek as long, _ Hour as long, Minute as long, Second as long, Tick as long year = 1952 : month = 5 : day = 3 call GregorianToHijri year, month, day print year, month, day call HijriToGregorian year, month, day print year, month, day wait end sub GregorianToHijri byref year, byref month, byref day SYSTEMTIME.wYear.struct = year SYSTEMTIME.wMonth.struct = month SYSTEMTIME.wDay.struct = day calldll #kernel32, "ConvertSystemTimeToCalDateTime", _ SYSTEMTIME as struct, CAL.HIJRI as long, _ CALDATETIME as struct, result as long year = CALDATETIME.Year.struct month = CALDATETIME.Month.struct day = CALDATETIME.Day.struct end sub sub HijriToGregorian byref year, byref month, byref day CALDATETIME.Year.struct = year CALDATETIME.Month.struct = month CALDATETIME.Day.struct = day CALDATETIME.CalId.struct = CAL.HIJRI CALDATETIME.Era.struct = 1 for dow = 1 to 7 CALDATETIME.DayOfWeek.struct = dow calldll #kernel32, "ConvertCalDateTimeToSystemTime", _ CALDATETIME as struct, SYSTEMTIME as struct, _ result as long next year = SYSTEMTIME.wYear.struct month = SYSTEMTIME.wMonth.struct day = SYSTEMTIME.wDay.struct end sub