Fix for incorrect Date/Time timestamp in emails
-
As reported in several places, users have trouble getting the correct timestamp in their contact form emails:
https://www.ads-software.com/support/topic/plugin-fast-and-secure-contact-form-timezone-incorrect-in-email-message?replies=2
https://www.ads-software.com/support/topic/plugin-fast-secure-contact-form-time-lag-between-sending-and-receiving
https://www.ads-software.com/support/topic/time-stamp-problem-with-fs-contact-form-pluginMy timezone is already set correctly as instructed here:
https://www.fastsecurecontactform.com/tip-set-timezoneSo I decided to look into the code.
It looks like the code just uses PHP’s plain time() method to get the timestamp. This will always be in UTC. So I corrected it to current_time(‘timestamp’) as according to the WordPress docs:
https://codex.www.ads-software.com/Function_Reference/current_timeThe changes must be made on lines 499 and 938 in file si-contact-form/includes/class-fscf-process.php . You can edit the plugin from within WordPress and just Ctrl+F (or Command+F) for time() and replace it.
Works great for me on WordPress 3.8.2 with FS Contact Form plugin 4.0.18.
- The topic ‘Fix for incorrect Date/Time timestamp in emails’ is closed to new replies.