Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8555435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:07:20+00:00 2026-06-11T15:07:20+00:00

Can I get the third Wednesday in php with strtotime (wed year-month +2 Weeks)

  • 0

Can I get the third Wednesday in php with strtotime (“wed year-month +2 Weeks”) or do I need a complex code like here: http://www.danielkassner.com/2010/05/22/get-date-by-position-ie-third-wednesday-of-january?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:07:21+00:00Added an answer on June 11, 2026 at 3:07 pm

    Try this:-

    /**
    * int nth_day_of_month(int $nbr, str $day, int $mon, int $year)
    *   $nbr = nth weekday to find
    *   $day = full name of weekday, e.g. "Saturday"
    *   $mon = month 1 - 12
    *   $year = year 1970, 2007, etc.
    * returns UNIX time
    */
    function nth_day_of_month($nbr, $day, $mon, $year)
    {
       $date = mktime(0, 0, 0, $mon, 0, $year);
       if($date == 0)
       {
          user_error(__FUNCTION__."(): Invalid month or year", E_USER_WARNING);
          return(FALSE);
       }
       $day = ucfirst(strtolower($day));
       if(!in_array($day, array('Sunday', 'Monday', 'Tuesday', 'Wednesday',
             'Thursday', 'Friday', 'Saturday')))
       {
          user_error(__FUNCTION__."(): Invalid day", E_USER_WARNING);
          return(FALSE);
       }
       for($week = 1; $week <= $nbr; $week++)
       {
          $date = strtotime("next $day", $date);
       }
       return($date);
    } 
    
    
    $d = nth_day_of_month($week_no,$curr_week_day, $fmonth, $fyear);
    
    echo date('d-m-Y',$d)."<br />";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that listens for announcements via UDP multicast. I can get
I need to parse a XML file which I get from third party to
is there a command that can get the third index of a character in
Hi I have written this code that with output you can get that .remove()
In JavaScript, we can get a number representing the current date/time like so: var
For what ever reason, a critical third peaty webservice functions like this. I can
How I can get the third value for the first key in this map?
I want to get 'second' in the following sample web address. http://www.mywebsite.com/first/sedond/third.html first can
Can get all triples with value null in specific field? All people with date_of_birth
We can get class Class object by 3 methods: MyClass.class obj.getClass Class.forName(className) I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.