The text that the phrase "this generation" comes from is Matthew 24:34.
Here it is in the immediate context of that chapter, after which I will analyze the "this generation will not pass away until all these things take place" statement:
Signs of Christ's Return
1Jesus came out from the temple and was going away when His disciples came up to point out the temple buildings to Him.
2And He said to them, "Do you not see all these things? Truly I say to you, not one stone here will be left upon another, which will not be torn down."
3As He was sitting on the Mount of Olives, the disciples came to Him privately, saying, "Tell us, when will these things happen, and what will be the sign of Your coming, and of the end of the age?"
4And Jesus answered and said to them, "See to it that no one misleads you.
5"For many will come in My name, saying, 'I am the Christ,' and will mislead many.
6"You will be hearing of wars and rumors of wars. See that you are not frightened, for those things must take place, but that is not yet the end.
7"For nation will rise against nation, and kingdom against kingdom, and in various places there will be famines and earthquakes.
8"But all these things are merely the beginning of birth pangs.
9"Then they will deliver you to tribulation, and will kill you, and you will be hated by all nations because of My name.
10"At that time many will fall away and will betray one another and hate one another.
11"Many false prophets will arise and will mislead many.
12"Because lawlessness is increased, most people's love will grow cold.
13"But the one who endures to the end, he will be saved.
14"This gospel of the kingdom shall be preached in the whole world as a testimony to all the nations, and then the end will come.
15"Therefore when you see the ABOMINATION OF DESOLATION which was spoken of through Daniel the prophet, standing in the holy place (let the reader understand),
16then those who are in Judea must flee to the mountains.
17"Whoever is on the housetop must not go down to get the things out that are in his house.
18"Whoever is in the field must not turn back to get his cloak.
19"But woe to those who are pregnant and to those who are nursing babies in those days!
20"But pray that your flight will not be in the winter, or on a Sabbath.
21"For then there will be a great tribulation, such as has not occurred since the beginning of the world until now, nor ever will.
22"Unless those days had been cut short, no life would have been saved; but for the sake of the elect those days will be cut short.
23"Then if anyone says to you, 'Behold, here is the Christ,' or 'There He is,' do not believe him.
24"For false Christs and false prophets will arise and will show great signs and wonders, so as to mislead, if possible, even the elect.
25"Behold, I have told you in advance.
26"So if they say to you, 'Behold, He is in the wilderness,' do not go out, or, 'Behold, He is in the inner rooms,' do not believe them.
27"For just as the lightning comes from the east and flashes even to the west, so will the coming of the Son of Man be.
28"Wherever the corpse is, there the vultures will gather.
The Glorious Return
29"But immediately after the tribulation of those days THE SUN WILL BE DARKENED, AND THE MOON WILL NOT GIVE ITS LIGHT, AND THE STARS WILL FALL from the sky, and the powers of the heavens will be shaken.
30"And then the sign of the Son of Man will appear in the sky, and then all the tribes of the earth will mourn, and they will see the SON OF MAN COMING ON THE CLOUDS OF THE SKY with power and great glory.
31"And He will send forth His angels with A GREAT TRUMPET and THEY WILL GATHER TOGETHER His elect from the four winds, from one end of the sky to the other.
Parable of the Fig Tree
32"Now learn the parable from the fig tree: when its branch has already become tender and puts forth its leaves, you know that summer is near;
33so, you too, when you see all these things, recognize that He is near, right at the door.
34"Truly I say to you, this generation will not pass away until all these things take place.
35"Heaven and earth will pass away, but My words will not pass away.
36"But of that day and hour no one knows, not even the angels of heaven, nor the Son, but the Father alone.
37"For the coming of the Son of Man will be just like the days of Noah.
38"For as in those days before the flood they were eating and drinking, marrying and giving in marriage, until the day that Noah entered the ark,
39and they did not understand until the flood came and took them all away; so will the coming of the Son of Man be.
40"Then there will be two men in the field; one will be taken and one will be left.
41"Two women will be grinding at the mill; one will be taken and one will be left.
Be Ready for His Coming
42"Therefore be on the alert, for you do not know which day your Lord is coming.
43"But be sure of this, that if the head of the house had known at what time of the night the thief was coming, he would have been on the alert and would not have allowed his house to be broken into.
44"For this reason you also must be ready; for the Son of Man is coming at an hour when you do not think He will.
45"Who then is the faithful and sensible slave whom his master put in charge of his household to give them their food at the proper time?
46"Blessed is that slave whom his master finds so doing when he comes.
47"Truly I say to you that he will put him in charge of all his possessions.
48"But if that evil slave says in his heart, 'My master is not coming for a long time,'
49and begins to beat his fellow slaves and eat and drink with drunkards;
50the master of that slave will come on a day when he does not expect him and at an hour which he does not know,
51and will cut him in pieces and assign him a place with the hypocrites; in that place there will be weeping and gnashing of teeth.
(Note: the CAPS are not my emphasis, they are the NASB's way of noting phrases that come from Old Testament passages.)
So what are the "all these things" that will take place within a generation? We have to read through the previous verses to find out.
First thing we notice is it says nothing about the rebirth of Israel or the recapture of Jerusalem. So there is no mandate that those dates are ones from which we should be calculating a generation.
Second, notice it says in v29 "after the tribulation of those days". So, as we all probably already know, the generational comment is for the Jews, something we already know from the historic context because Jesus is providing this entire sermon before a Jewish audience and warning them in this part of it about the last days. And this is precisely why when we calculate generations of 40 or 70 years, we're inclined to do it from the rebirth of Israel or the recapture of Jerusalem. We know this is talking primarily to a Jewish audience, but in the wisdom of God, there is also information in here for the church to understand.
The tribulation/great tribulation comments in those verses also tell us that the generational time period will include the 70th week (go back to the previous verses and read what is described during "the tribulation of those days" and that is clear) and so we are talking about the Second Coming of Christ as the endcap for this period of time, not the rapture. The end of the generational period he is describing will include the Second Coming.
So what we know so far is that the events described will end with the Second Coming and a gathering by angels, which is at an unspecified date, and from there we would go backward no more than a generation, which could be most commonly 40 or 70 years, during which time all these events will unfold. But as we'll see shortly, it's not about 40 or 70 years: the point of Jesus saying that everything will happen within a generation is simply to emphasize that all these things will happen within one generation, meaning less than 40-70 years. In fact, most of it will happen within roughly 7 years' time.
Next, we should note that verse 14 speaks of the gospel being preached to all nations BEFORE the end coming. Now, is that the end of the church age or the end of the 70th week? If it's the end of the church age, we still have some time to go before that will be accomplished by human means. If it's the end of the 70th week that's implied there, then that is handled by the 144,000 Jewish gospel evangelists or the angel flying to and fro in the heavens, both of which are spoken of in Revelation as events that occur during the 70th week. So don't let that verse throw you off into thinking that none of this can happen until we actually somehow preach the gospel to every last peoplegroup. God will ensure that happens during the 70th week if we don't manage to do it before then.
The passage also talks about perilous times, all sorts of apostasy and deception. We see plenty of that today, including on endtimes website with all sorts of false prophets and prognosticators being heeded by many, as v24 says "so as to mislead, if possible, even the elect". We have large-scale apostasy in the mainline denominations today, and plenty of "false Christs" going about. So this sign is already visibly occurring today.
So what is the next thing to happen during this period of time? v29-31: Immediately after those days (of rampant deception), all sorts of crazy things will happen in the heavens with the sun, moon, and stars. We haven't seen that yet. Every sign in the sky is within the norm, yes including eclipses. These are not anywhere near the type of events described in the Bible during the end times. Given what we read in other end times prophetic passages in the Bible, these verses seem to best apply events that happen during the 70th week. This also makes sense in light of what it says about Jesus returning and everyone seeing him and mourning, and sending his angels to gather together his elect, which is all language that aligns more with the Second Coming to Jerusalem and to the judgment than with a rapture in the blink of an eye.
In v32, He goes on to liken these events to the timing of a fig tree's shoots growing in relation to summer arriving - when you see these things beginning to happen (and I'd say we're well past the beginning of the first things listed like growing deception and apostasy), you know that Jesus's return is very near (and this part may indeed speak to the nearness of the rapture). And it then begins talking about a day which no one knows the date of and we tend to interpret these verses as talking about the rapture, particularly because if people saw all the signs leading up to the Second Coming they would not be so totally unaware and unexpectant of it, where as the language in these verses speak of an event that catches everyone by surprise, which would more likely be an event at the beginning of the 70th week (the rapture), not near the end of it (the Second Coming).
So basically this passage says that the generation that goes through the perilous times of the tribulation during the 70th week, will also see the Second Coming because all those things will happen within a fixed period of time that is less than a generation in length. In fact, we know that the 70th week itself will be roughly 7 years in length, and thus well within a generational time period. Some of the events mentioned in the passage may begin prior to the 70th week, and we also learn that the suddenness of these things taking place will take people by surprise.
Anyway, I hope this brief analysis has been helpful. The point of it was to examine the context of the famous "this generation will not pass away until all these things take place" statement that we've all heard but few have bothered to understand and examine. It actually has no clear connection to the date of Israel's rebirth or the recapture of Jerusalem. I wish it did, honestly, because then we would be assured of a timeframe for the Second Coming. But it's not. So unless there's another passage that says "all these things will happen within a generation" and the same passage also says the "these things" will include the date of Israel's rebirth or Jerusalem's recapture, we're not right to force a 40 or 70 year timeframe based on those events and demand the Second Coming must be at 40 or 70 years from 1948 or 1967.
I think a better reason for why we should expect the Second Coming in 2017 is because that is supposedly a Jubilee year, if 1967 and 1917 were, and significant events for Israel often happen in relation to Jubilee years (c.f. Leviticus ch.25) like the Balfour Declaration and the recapture of Jerusalem, which being exactly 50 years apart does give some weight to the claim that those are Jubilee years. And we anticipate that when Jesus returns He will declare a year of Jubilee.
It also happens to be roughly 70 years since Israel was reborn, and the number 7, especially emphasized by being multiplied by 10 to emphasize completeness, is a significant number in the Bible used by God to note important prophetic events like Daniel's 70 weeks of years for the completion of God's redemption of the Jews and doing away with sin (the 483 years (69 weeks of years) from Nehemiah's rebuilding of the walls of Jerusalem to the entrance of Messiah Jesus into Jerusalem the first time plus the final week of 7 years that happens in the end times).
We also have so many current events that show us the time is near for our Lord's return for the church. So if that's the case, we are indeed very near the beginning of the 70th week and thus the rapture is indeed close -- certainly closer than it ever has been, so take heart, and be ready!