I am afraid that I do not have any VB6 code handy, however the following C# should point you in the right direction:
// Tomohiko Sakamoto's algorithm (alternative to Zeller's Congruence)
string[] DayNames = new string[] { "Sun","Mon","Tue","Wed","Thu","Fri","Sat" };
int[] t = new int[] { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 };
if (mm < 3) yy = yy - 1;
int dow = (yy + yy/4 - yy/100 + yy/400 + t[mm-1] + dd) % 7;
return DayNames[dow];
Where, dd, mm and yy represent the date, e.g. 01, 02, 2006
More here:
http://www.cs.uwaterloo.ca/~alopez-o/math-faq/mathtext/node39.html
http://www.merlyn.demon.co.uk/datelinx.htm
http://en.wikipedia.org/wiki/Zeller's_congruence
From:
http://www.developerfusion.co.uk/forums/thread/97438/
Enter your message below
Sign in or Join us (it's free).