What day is today? Monday? Sunday?
BlitzMax Forums/BlitzMax Programming/What day is today? Monday? Sunday?
| ||
anyone know a better way to get it? |
| ||
Have you tried googling up 'Julian Day Calculator' ? Here's a link with some Java source: http://www.numerical-recipes.com/julian.html For tabbing (via Print) try using ~t inside the "" Not that this helps but I have a 'days between 2 dates caculator' which I might as well share with you: ' Juilan day calculator ' How many days between two dates? Strict Type jdcType Global month:TList Method New() month=New TList month.AddLast "JAN" ; month.AddLast "FEB" ; month.AddLast "MAR" month.AddLast "APR" ; month.AddLast "MAY" ; month.AddLast "JUN" month.AddLast "JUL" ; month.AddLast "AUG" ; month.AddLast "SEP" month.AddLast "OCT" ; month.AddLast "NOV" ; month.AddLast "DEC" End Method Function FindMonth(fm$) Local mcount% For Local m$=EachIn month mcount:+1 If fm.ToUpper() = m$ Return mcount Next End Function Function JulianDays(txt$) Local d=Int(Left(txt$,2)) Local m=Int(FindMonth(Mid(txt$,4,3))) Local y=Int(Right(txt$,4)) Local jd=(1461*(y+4800+(m-14)/12))/4+(367*(m-2-12*((m-14)/12)))/12-(3*((y+4900+(m-14)/12)/100))/4+d-32075 Return jd End Function End Type Local jdc:jdcType=New jdcType Local todate$="25 DEC 2005" Print "~n Days between TODAY and "+todate$+" = "+(jdc.JulianDays(todate$) - jdc.JulianDays(CurrentDate())) End |
| ||
Thanks, I'll check the page and find the way to get the day. |
| ||
http://www.blitzbase.de/quellcode/datumarithmetik.bb codes for bb2d/3d/plus |