# Tapani Tarvainen wrote in message ... # day of week in awk, 1=Monday ... 7=Sunday function dow(day, month, year) { x = 12*year + month - 3 y = int(x/12) l = int(y/4) - int(y/100) + int(y/400) return (int((734 * x + 15)/24) - 2*y + l + day + 1) % 7 + 1 } #Works for Gregorian calendar only, doesn't check input in any way, #may not work for you etc etc. Copyright mine but permission is hereby #granted to use it for any and all purposes without paying me anything.