From: Rabbi Moshe Sofer
To: Rabbi Shabsai Elchanan
A rabbi returning safely from a sea voyage recites Birkas HaGomel at a nighttime communal celebration, prompting objections that it should parallel the daytime Korban Todah. The Chasam Sofer rules the nighttime recitation was correct as a hora'as sha'ah, arguing that for sea travelers the obligation derives from Tehillim 107 rather than the Todah offering, and that withholding the berachah before an assembled congregation would have been improper.
Source: Shu"t Chasam Sofer OC §51