Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Mod (Modulo) Function
a=TimeYmdHms( ) b=TimeJulianDay(a)c=((b+5) mod 7) + 1 day=ItemExtract(c, "Sun Mon Tue Wed Thu Fri Sat", " ") realdate = TimeJulToYmd(b) line=StrCat("Julian Date-> ", b,@CRLF,"Day of week-> ",day,@CRLF,"Real date-> ",realdate)
Basically it means "divide by 7 and keep the remainder"
It is used to figure conver the julian date to a number between 0 and 6 that can be used to figure out the day of the week.
About the same as (baring typos)
bignum=123456 temp=bignum / 7 mod7 = bignum - (temp * 7)or just
mod7 = bignum mod 7
a=TimeYmdHms( )
b=TimeJulianDay(a)
c=((b+5) mod 7)
;Message("day of week 0 - 6",c)
days2sunday=7 - c
;Maybe if today is sunday, did you want *next* sunday?
; if days2sunday==0 then days2sunday=days2sunday+7
juliansunday=b+days2sunday
sunday=TimeJulToYmd(juliansunday)
Message("Sunday",sunday)
Article ID: W15503
File Created: 2003:05:28:10:20:48
Last Updated: 2003:05:28:10:20:48