People enjoy the beach at Coney Island Friday, July 19, 2019, in the Brooklyn borough of New York. An excessive heat warning remains in effect throughout the metropolitan area. (AP Photo/Frank Franklin II)

NEW YORK (AP) — New York City officials have canceled an outdoor festival featuring soccer star Megan Rapinoe, musician John Legend and "Daily Show" host Trevor Noah because of the heat forecast for the weekend.

OZY Fest had been scheduled for Saturday and Sunday in Central Park. Mayor Bill de Blasio announced Friday it has been canceled.

A de Blasio spokeswoman says a Times Square commemoration of the 1969 moon landing has been canceled, as well.

Officials earlier announced the cancellation of the New York City Triathlon, scheduled for Sunday.

Temperatures in the high 90s are forecast for Saturday and Sunday with a heat index well over 100. Much of the nation is also dealing with high heat.

De Blasio has directed owners of office buildings over 100 feet (30 meters) tall to set thermostats to 78 degrees Fahrenheit (26 degrees Celsius) through Sunday to conserve energy.

People cool themselves by jumping into Lake Michigan at Chicago's North Ave Beach on Friday, July 19, 2019. A heat wave hits the Chicago greater area and temperatures are expected to reach high 90s. (AP Photo/Amr Alfiky)
Lynn Mcclelland, right, watches his grandson flip over backwards in South Pond at the Greenwood Town Beach as he and his friend, Barbara Phelps, stay cool in the shade, Friday, July 19, 2019 in Greenwood, Maine. The two are from the Greenwood area but their grandson, Jay Penta, is from New Hampshire visiting here on vacation. (Russ Dillingham/Sun Journal via AP)
Pitchfork Music Festival attendees of the first day of the music festival braved record-setting temperatures in Chicago, Friday, July 19, 2019. (Santiago Covarrubias/Chicago Sun-Times via AP)
Baltimore Orioles outfielder Keon Broxton douses himself with water while taking a break between fielding and batting practice prior to a baseball game against the Boston Red Sox, Friday, July 19, 2019, in Baltimore. A heat wave is hitting Baltimore and heat advisories have been set ahead of a hot weekend. (AP Photo/Julio Cortez)
Children and adults escape 90 degree temperatures as they cool off in The Whirlpool Compass Fountain Friday, July 19, 2019, in St. Joseph, Mich.(Don Campbell/The Herald-Palladium via AP)
People enjoy sun near the Wonder Wheel at Coney Island beach Friday, July 19, 2019, in New York. An excessive heat warning remains in effect throughout the metropolitan area. (AP Photo/Frank Franklin II)
People enjoy the beach at Coney Island Friday, July 19, 2019, in the Brooklyn borough of New York. An excessive heat warning remains in effect throughout the metropolitan area. (AP Photo/Frank Franklin II)