|
-
Nov 28th, 2000, 10:10 AM
#1
Thread Starter
Lively Member
hi all
does anyone know a formula to find out what day of the week it is given a date, a month and a year (years ago I was given it at Uni). This is purely mathematical formula it takes into an account leap years as well and it can give you what day it was on 01/01/0001 for example
Thanks
Ilia
-
Nov 28th, 2000, 10:33 AM
#2
Fanatic Member
I know the formula you mean and I can't remember it either, but you could use DateDiff to return the number of days difference and use Mod 7 to work out the relative difference from today.
Cheers,
P.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 28th, 2000, 10:38 AM
#3
Addicted Member
Can this meet your needs?
Code:
------------------------------
Text1.Text = Weekday(#1/20/1960#)
------------------------------
-
Nov 28th, 2000, 11:15 AM
#4
Fanatic Member
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 28th, 2000, 02:20 PM
#5
Fanatic Member
If you need the name of the day of the week, use:
Code:
Text1.Text = WeekdayName(Weekday(#1/20/1960#))
In VB, the week starts on a Sunday, but you can change that in the parameters for both Weekday and WeekdayName.
-
Nov 28th, 2000, 03:18 PM
#6
Code:
MsgBox Format(Date, "dddd")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|