Boosted heavily by opening night fanboy appeal, Warner Bros.’ ”The Hangover Part II” scored a sterling $31.7 million on Thursday, making it the third-best gross of all-time on that day but the best start for an R-rated comedy.

”Hangover II,” with its added record-setting $10.4 million midnight take on Wednesday, beat last year’s $26.7 million Friday debut of ”Sex and the City 2,” which currently holds the industry record for the best opening weekend of an R-rated laffer.

Also bowing early on Thursday, Paramount-DreamWorks Animations’ ”Kung Fu Panda 2” grossed $5.8 million from Stateside plexes.

”Panda 2” wasn’t expected to catch the frame on fire since only 10% of K-12 students were on school vacation that day, though solid reviews and an A CinemaScore rating will bode well for the film as it plays through Memorial Day. Toon should have a better Friday, with approximately 20% of kids out of school, while the rest of the weekend should build into a boffo Monday result.

”Panda 2” likely will beat ”Hangover II” on Memorial Day, considering the holiday typically has been a big family day at the box office with parents off work.

But that all depends on the amount of heat ”Hangover II” continues to develop this weekend.

Warner’s “The Matrix Reloaded” also bowed on a Thursday, with $42.5 million – the No. 2 opening for that day – and went on to gross an additional $91.8 million through its first Sunday in 2003, currently the highest opening for an R-rated pic ever. (Fox’s “Star Wars: Episode III – Revenge of the Sith” still holds the record for the biggest Thursday bow at $50 million.)