Whats wrong with DateTime object

Posted by Ayaz Alavi on Stack Overflow See other posts from Stack Overflow or by Ayaz Alavi
Published on 2010-05-31T12:43:32Z Indexed on 2010/05/31 12:53 UTC
Read the original article Hit count: 283

Filed under:
|
|

Hi, Can anyone tell what is wrong with the code.

$timezone = "Asia/Karachi"; 
$date = new DateTime($when_to_send, new DateTimeZone($timezone));
$date = $date->setTimezone(new DateTimeZone('GMT')); 
$when_to_send = $date->format('Y-m-d H:i:s');

error is: Call to a member function format() on a non-object

© Stack Overflow or respective owner

Related posts about php

Related posts about datetime