1

I am having problems sending mailings/campaigns.

The following works:

  • bounce handling account is correctly set, successfully tested
  • cron job is running correctly (no errors, I can also see it in the logs)
  • the default email for sending is set to the same as bounce handling account
  • username/password all correct, access is through imap
  • sending details are all correct
  • selecting a contact (like one with one of MY email addresses) I can send a direct email to it with EITHER the logged in user OR the main email address, both arrive
  • there is NO error reported in system status related to any of this (other than PHP)

So for testing I create a Mailing:

  • just mailname
  • no campaign/template
  • from same as bounce
  • recipients set to a group of MY email addresses I know work
  • a subject and a couple of lines in body

If I use "send immediately" it yells at me "Error: the scheduled time is in the past". When I check the times it tells me:

  • the mailing was created November 24th, 2024 5:02 AM
  • BUT it's currently 16:08 in the afternoon - the scheduled time is about 3 minutes behind but ALSO in the past.

My time zone of the CMS is Melbourne. Where do I set the timezone in CIVICRM?

2
  • When I do "mysql> select now();" it reports the CORRECT time, so the MYSQL server knows what time it is with respect to the timezone. However when I check the systemstatus in CIVICRM it tells me Timestamps reported by MySQL (eg "2024-11-24 06:14") and PHP (eg "2024-11-24 17:14" ) are mismatched.
    – Jobst
    Commented Nov 24 at 6:15
  • CiviCRM can be rude!
    – Alan Dixon
    Commented Nov 25 at 16:49

2 Answers 2

3

Unfortunately, there are still issues with timezones in CiviCRM, it's complicated, and you'll see lots of solutions to different and somewhat unrelated timezone related issues.

The short answer to your issue is probably to convert your mysql to use universal time instead of local time, it looks like CiviCRM php code is assuming that.

CiviCRM itself doesn't have a timezone setting (reasonably!), though it can (or at least, in the past it did) borrow individual and default timezone presentation default timezones from the CMS. Yes, very confusing.

The other angle you might try is the use of the Doctor When extension, which does some work to untangle the timezone problem in some places by converting timestamp fields to date-time fields in the mysql tables.

1
  • Thanks, @AlanDixon See my answer.
    – Jobst
    Commented Nov 26 at 23:21
3

To be able to use CiviCRM with proper times in calendar/scheduling I had to start from PHP.

In php.ini I had the timezone set to Australia/Melbourne. My first steop I took this out, then tested CiviCRM and indeed CiviCRM now has the correct times.

Because I have many OTHER softwares running on the system (non wordpress) I had to include

// taken out in php.ini. set it here.
date_default_timezone_set('Australia/Melbourne');

I will keep adding this to other softwares requiring this after I took it out from php.ini

I checked SuiteCRM and a CALDAV server on the system, I added the line to the caldav server, so far so good.

Scheduling a Mailing, saving a Mailing etc have now the correct times set and sending of the Mailing now happens at the correct time.

Not that I wanted the extra effort but I want to support CiviCRM.

I hate Nationbuilder with a passion, their system language - liquid - is stuck in the 2010s.

1
  • FWIW, I've got my php default timezone reported as America/Toronto, but I don't set it in my .ini file, so I suspect it's getting set by Drupal. I think most responsible systems shouldn't use or require a system setting for the timezone (in order to support cloud providers as much as anything), but that's easy for me to say! Thanks for supporting CiviCRM.
    – Alan Dixon
    Commented Nov 28 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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