DateTime() problem...
Brought to you by:
alimbas
Although you had the code fix to the numeric pdt to a date, it was wrong. The original said:
$pdt = new DateTime(); $pdt->setTimestamp($pdt);
As you can see, you use $pdt as the input number after assigning a DateTime object to it. I would suggest something more like this:
# workaround for import if(is_numeric($pdt)){ # >= php 5.3 $time = $pdt; $pdt = new DateTime(); $pdt->setTimestamp($time); #$f = setDateFormat(null,1); #$time = date($f,$pdt); #$pdt = new DateTime($time); }
Also, I have PHP 5.4.9 and the other code did not work completely preventing the creation of new fields in the database. I'm thinking that you could enhance the code by adding a test of the PHP version and select one or the other of the code based on that.
Yes, I think php <= 5.3 is not longer needed for this ..
I changed it in svn
Cool! I see that you use a new name for the parameter: $stamp. Only the commented out code still uses $pdt as input of date(). You may want to change that, just in case someone needs it in their version.
Yes thanks for improve
I change it