1

When I'm logged in -> and make a Contribution at 4:20pm - all is well!

I log out and then make a Contribution through the exact same Contribution page and notice that the Contribution clocks in at 10:24pm (so +6h - that's UTC I think as I believe the UK did their timezone change last weekend);

Any clues as to what may be going on here? This is on Drupal 8 / CiviCRM 5.15.1

My default time zone in Drupal is set to Edmonton [Canada]. The 4:20pm was correct.

enter image description here

Additional Info:

  • CentOS thinks it's ET (+2h) - which is fine [machine is in Montreal];

This docker instance: php -v => PHP 7.3.7 php -i |grep time provides two clues:

  • Default timezone => UTC
  • date.timezone => no value => no value

For a D7 project on another server [works fine no +6h time issues - D7 site] -> same server config (but PHP 7.1.29):

  • CentOS is in ET (+2h) - which is fine [machine is in Toronto]
  • Default timezone => UTC
  • date.timezone => no value => no value

So D8/PHP 7.3.7 vs D7/7.1.29

  • 1
    What is the OS time zone? Also the time zone in php.ini (date.timezone)? – Demerit Oct 31 '19 at 3:35
  • I've added some more info above. Looks like a difference in default behavior D7 vs D8 [i.e. our server / php config is the same]; – KarinG - Semper IT Oct 31 '19 at 12:58
1

The main clue is that these date/times are being stored in mysql datetime fields, which do not include a timezone, but implicitly have a server-wide timezone (either adopted from the server, or configured explicitly).

So we know that the problem is at the php level - the code is generating the date time and converting based on the current user's timezone (which it shouldn't in this case).

Since it's an issue with D8 and not for D7, it seems likely that it's a D8 integration issue, some kind of automated handling of date/times that we don't want (we do want date/times to be converted to the users timezone on display).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.