Results 1 to 6 of 6

Thread: how do i found out what day of the week this is?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    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

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    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...

  3. #3
    Addicted Member
    Join Date
    Sep 2000
    Posts
    138
    Can this meet your needs?

    Code:
    ------------------------------
    Text1.Text = Weekday(#1/20/1960#)
    ------------------------------

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    New one to me... Cool

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  5. #5
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    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.

  6. #6
    Guest
    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
  •  



Click Here to Expand Forum to Full Width