I am using Zend framework for the site which sends email for the voucher order with a pdf attachment in the email. Everything work fine with the site but the Expiry date sending to the pdf alone have problems. I have passed the expiry date parameter from my database table values but it always takes the some default value of 1-1-1970. I have used the following set of codes for the pdf attachment with the email.
$endDate = new Zend_Date();
$endDate->set($data['voucher']['enddate']);
$endDate= $endDate->toString('dd/MM/YYYY');
//build PDF voucher attachment
$at = $this->generateVoucherPDFAttachement($recipientName, $customerName, $data['order']['msg'], $order['vouchercode'], $endDate);
$this->_helper->Mail(array(
'smile@ipressprinting.com.au' => 'Smile@iPress',
'info@ipressprinting.com.au' => 'Info@iPress',
), 'New voucher order #' . $data['order']['id'], $mailMsg, $at);
Which is the format of
$data['voucher']['enddate']? You should take care of it when building aZend_Dateobject, otherwise it will use an heuristic based on current locale to parse the date given.Usually if the date comes from a db field (i.e. yyyy-mm-dd) you can build a Zend_Date in this way: