Make sure to check the date and set its proper time zone because even if you set it normally, but the time zone differs, you will still receive the same error since WhatsApp uses your location.
Go to Settings > Date and Time and set the correct time zone where you live then WhatsApp should function normally.