The phrase a whale of a (good) time denotes a hugely enjoyable time.
Of American-English origin, this phrase alludes to the enormousness of whales.
These are the earliest occurrences of the phrase that I have found, in chronological order:
1-: From The Emporia News (Emporia, Kansas) of Friday 14th July 1871:
The German peace jubilee at Lafayette, Indiana, on the Fourth, was a grand demonstration. Four steam printing presses were in it, representing four German printing offices, and a large number of notable characters in the history of Germany were represented. The Teutons do not go half-way and stop in any matter of this kind. They never have a time, but they have a whale of a time.
2-: From a letter from Barbour County, West Virginia, by ‘Joab Squash’, published in The Wheeling Daily Register (Wheeling, West Virginia) of Wednesday 18th June 1873:
A party of our young bloods, headed by Lieut. Brown, of the U. S. flag ship Alaska, made a raid to Elk creek, during this week, for the purpose of capturing some of the finny tribe, to transplant to the waters of the Valley river. They returned this morning with five “duckens,” four headaches, one rheumatism, one lameness, two corns, three drooping straw hats, one abused stovepipe, five dilapidated gentlemen, two M. T. Jugs, two hogsheads of water, eleven fish and a “whale” of a good time. It is rumored that they would not have got back at all but for the “gallantry” and “daring” of the commander. The party has gone into winter quarters, and the fish are happy.
3-: From The Comet (Jackson, Mississippi) of Saturday 4th October 1879:
Mr. J. H. Odeneal gives a lively description of the grand turnout of Greenbackers 1 last Saturday. Ample preparations had been made for a whale of a time.
1 The noun Greenbacker designated a member of the Greenback party, which opposed the shift back to gold-based currency and advocated government control of the monetary system, with greenbacks as the sole currency. So called with reference to the devices printed in green ink on the reverse of the original monetary notes, greenbacks were monetary notes issued by the United States during and immediately after the American Civil War (1861-65), and not backed by gold or silver.
4-: From The Daily Inter Ocean (Chicago, Illinois) of Sunday 29th July 1883—here, however, the phrase seems to be used, perhaps ironically, to denote an unenjoyable time:
GUTRIPPAH ON YACHTING.
The Gentleman from Kentucky Meets an Aggregation of Unfortunate Circumstances on the Lake.
“I done had a whale of a time they othah day, sah,” said Colonel Gutrippah yesterday.
“What was it, Colonel,” asked the reporter. “Why, how sunburned you are, and how your nose peels! What is the matter?”
“Well, sah, I’ll tell you all. I done took a ride on a cussed, condemned sailboat, sah. I considah myself fohtunate to get back alive, sah. You all heahs me. I’m a-talking loud, sah.”
5-: From the Daily Evening News (Lincoln, Nebraska) of Friday 1st February 1884:
A whale of a time was enjoyed last night, by McGift, Dougherty, Snider and another “bum” now confined in the city jail. The unruly gang were handcuffed and order was restored. McGift was handcuffed behind, Dougherty chained to a lamp-post, and ball and chain hung to the heels of the other fellow.
6-: From Local News, published in the Phillipsburg Times (Phillipsburg, Kansas) of Saturday 24th January 1885:
Bro. Lewis seems to be having a whale of a time at Topeka. Look out “Chan.” that you don’t get seduced.
7-: From the Clinton Register (Clinton, Illinois) of Friday 11th December 1885:
It Was “Jonah.” 2
This morning as we came to the Register office, we beheld fragments of partly digested cabbage, bread, potatoes, “and other articles too numerous to mention” (“terms made known on day of sale”) lying on the walk, on the stairs, at the door—everywhere; and there arose to greet our scent, perfumes of whiskey, “sour mash” “Tom and Jerry,” and several others whose names we did not learn. With much difficulty we made our way through the ruins to the sanctum, much fatigued about the nose. In fact, our olfactory accommodations were almost completely exhausted; and for a while we let them “lie down to pleasant dreams,” but every few moments, without a word of warning, they would involuntarily exclaim “oo-ah! oo-ah!” The odor of the ruins upon the stairs clung to their memory so visibly that an occasional “oo-ah” was necessary for relief. Oh, it was a picnic for our nose; but it would much rather hold an interview with the smell of a den of grown skunks than again wade through the odors arising from such a defunct “lay out” of gastronomical solids and juices.
In this case “Jonah” was the most successfully “strung out” he ever was. There was Jonah from the office door to the coal pile, and most of the way back. He had more than a “whale” of a time, Jonah did. There he lies yet, exposed to the chilling blasts of the cold December winds, alone and deserted. Poor Jonah! He was “thrown out” of employment, because his employer got too “full” of him.
But to business. If the young man who deposited the contents of his overtaxed stomach at our door will call, prove property, and pay for this notice, he can have the basket full of vegetables and spirited debris which he departed so unceremoniously.
2 In this text, a whale of a time is used punningly with allusion to the ‘great fish’ which swallowed Jonah in the Book of Jonah, and the name Jonah refers to matter vomited from the stomach, with allusion to the fact that God commanded the ‘great fish’ to vomit Jonah out—Book of Jonah, 2:10, in the King James Version (1611):
And the Lord spake vnto the fish, and it vomited out Ionah vpon the drie land.