PGTYPESdate_dayofweek(date dDate)
{
	/*
	 * Sunday:	0 Monday:	   1 Tuesday:	  2 Wednesday:	 3 Thursday: 4
	 * Friday:		5 Saturday:    6
	 */
	return (int) (dDate + date2j(2000, 1, 1) + 1) % 7;
}
PGTYPESdate_dayofweek(date dDate)
{
	 
	return (int) (dDate + date2j(2000, 1, 1) + 1) % 7;
}