Results 1 to 3 of 3

Thread: [RESOLVED]Get the day of the week of a certain day (ex: what day of the week was 1st)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    Resolved [RESOLVED]Get the day of the week of a certain day (ex: what day of the week was 1st)

    How would I go about getting the day of the week of a certain day?

    I want to make a calendar and I want to know what day is the first day (ex if March 1st is on a Friday)...

    Right now I could use a combination of date(N) ( numeric representation of the day of the week ) and date(j) (Day of the month) then do some % math to figure it out, but there must be a better way.

    Any ideals? I figure there must be a way to do this using date(N) but specifing what day you want to know (as opposed to the current day)
    Last edited by Zeratulsdomain; Mar 5th, 2008 at 08:48 AM.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Get the day of the week of a certain day

    Have a look at the getDate() function.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    Re: Get the day of the week of a certain day

    tnx, this line of code does the trick (with "wday")
    Code:
    print_r(getdate(date("U", mktime(0, 0, 0, 12, 1, 2008))));
    That saves me lots of un-needed math :P

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