Reputation: 287
Is there a way to set the time zone for one specific email at a time in PHPMailer
?
People want their notification emails to be in their time zone (so they don't have to do the math), but everywhere else in the app needs to be whatever it's set to already, so global (date_default_timezone_set(‘Asia/Calcutta’);
) and config file editing is out of the question.
Any hints?
Upvotes: 1
Views: 1391
Reputation: 75646
date_default_timezone_set()
is NOT global. What is set global sits either in php.ini
or is set via .htaccess
. Calling date_default_timezone_set()
sets TZ in scope of invoking script only, so simply calling it prior building mail should be perfectly sufficient
Upvotes: 6