'Using date_default_timezone_set('Etc/UTC') in PHPMailer
I'm using PHPMailer in my project and I want to deploy it into an domain that I own for tests.
I found an example using SMTP in GitHub, and I'm using it on the project (https://github.com/PHPMailer/PHPMailer/blob/master/examples/smtp.phps). It works fine but I'm not quite sure if I should include the following line in my code:
<?php
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
?>
I'm pretty sure my default timezone is set on the server, and I would like to know if setting it again could cause any problem or side effects in my code.
note: I work with php DateTime class in my project but every time I create a new instance of it, I specify its DateTimeZone. Cheers !
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
