Results 1 to 5 of 5

Thread: Calculate a specific date

  1. #1

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    Cool Calculate a specific date

    hello people long time no forum for me, sorry i was wondering how i could calculate the 2nd sunday of every month in php or something similar i had a look at strtotime() but couldnt think of how to use it

    thanks for your help

    senorbadger

  2. #2
    Addicted Member techwizz's Avatar
    Join Date
    Apr 2005
    Location
    U.S.A.
    Posts
    246

    Re: Calculate a specific date

    I dont know...but since no-one had replied.. i would possibly suggest using a julian date.

  3. #3
    Lively Member skv_noida's Avatar
    Join Date
    May 2005
    Location
    Noida, India
    Posts
    76

    Re: Calculate a specific date

    have to go for own function




  4. #4

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    Re: Calculate a specific date

    i think i have a solution

    the user will provide a start date so...

    eg: user enters "5/06/2005" (UK date)

    this is really in effcient

    my script can use mktime() to get the value for "next sunday"

    in a loop store the value given for next "sunday" and calculate the next sunday do this 4 times

    that gives the the same sunday the next month

    though its not the best way do u think it will work ?

  5. #5
    Addicted Member techwizz's Avatar
    Join Date
    Apr 2005
    Location
    U.S.A.
    Posts
    246

    Re: Calculate a specific date

    Well the days of monts vary from 28 to 31? Is that not an issue?

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