On August 4.1977 ; U.S. President Jimmy Carter signs legislation creating the United States Department of Energy.