We found that significant errors occurred when diurnal data instead of diurnal–nocturnal data were used to calculate the daily sea-air CO2 flux (F). As the errors were mainly associated with the partial pressure of CO2 in seawater (pCO2w) and the sea surface temperature (SST) in the control experiment, pCO2w and SST equations were established, which are called the nocturnal effect of the CO2 flux. The root-mean-square error between the real daily CO2 flux (Freal) and the daily CO2 flux corrected for the nocturnal effect (Fcom) was 11.93 mmol m−2 d−1, which was significantly lower than that between the Freal value and the diurnal CO2 flux (Fday) (46.32 mmol m−2 d−1). Thus, the errors associated with using diurnal data to calculate the CO2 flux can be reduced by accounting for the nocturnal effect. The mean global daily CO2 flux estimated based on the nocturnal effect and the sub-regional pCO2w algorithm (cor_Fcom) was −6.86 mol m−2 y−1 (September 2020–August 2021), which was greater by 0.75 mol m−2 y−1 than that based solely on the sub-regional pCO2w algorithm (day_Fcom = −7.61 mol m−2 y−1). That is, compared with cor_Fcom, the global day_Fcom value overestimated the CO2 sink of the global ocean by 10.89%.