You are here

public static function PhpMailerSmtp::rfcDate in PHPMailer SMTP 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/Mail/PhpMailerSmtp.php \Drupal\phpmailer_smtp\Plugin\Mail\PhpMailerSmtp::rfcDate()
  2. 2.0.x src/Plugin/Mail/PhpMailerSmtp.php \Drupal\phpmailer_smtp\Plugin\Mail\PhpMailerSmtp::rfcDate()
  3. 2.1.x src/Plugin/Mail/PhpMailerSmtp.php \Drupal\phpmailer_smtp\Plugin\Mail\PhpMailerSmtp::rfcDate()

Wrap PHPMailer::RFCDate() to return the current timezone.

File

src/Plugin/Mail/PhpMailerSmtp.php, line 300

Class

PhpMailerSmtp
Implements the base PHPMailer SMTP class for the Drupal MailInterface.

Namespace

Drupal\phpmailer_smtp\Plugin\Mail

Code

public static function rfcDate() {
  $tz = date('Z');
  $tzs = $tz < 0 ? '-' : '+';
  $tz = abs($tz);
  $tz = (int) ($tz / 3600) * 100 + $tz % 3600 / 60;
  $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
  return $result;
}