ax7h_g
Last Updated: February 25, 2016
·
502
· dionysios

Day of the Week in Q

q
kdb

The way dates are represented in Q makes it easy to find the day of the week when given the date.
Since all dates are internally stored as integers corresponding to the number of days since 2000.01.01 and since that date happened to be a Saturday, a simple function to give the day is:

todayIs ::`Sat`Sun`Mon`Tue`Wed`Thu`Fri .z.D mod 7