Re: [PHP-DEV] int|float for DateTime::setTimestamp

2024-02-13 Thread Ayesh Karunaratne
> > just like the constructor accepts > new DateTime("@0.123456"); // 1970-01-01 00:00:00.123456 > new DateTime("@".microtime(true)); > > IMO setTimestamp should accept the same: > $dt->setTimestamp(0.123456); // 1970-01-01 00:00:00.123456 > $dt->setTimestamp(microtime(true)); > > Can we change

[PHP-DEV] int|float for DateTime::setTimestamp

2024-02-13 Thread Hans Henrik Bergan
just like the constructor accepts new DateTime("@0.123456"); // 1970-01-01 00:00:00.123456 new DateTime("@".microtime(true)); IMO setTimestamp should accept the same: $dt->setTimestamp(0.123456); // 1970-01-01 00:00:00.123456 $dt->setTimestamp(microtime(true)); Can we change setTimestamp to