-1
I have the following code PHP
:
1 $timestamp = $stuMessage->unixTime;
2 fwrite($fh, "timestamp: ".$timestamp."\r\n");
3 $data = gmdate("Y-m-d", $timestamp);
4 $data2 = gmdate("Y-m-d", 1541421652);
5 fwrite($fh, $data. "\r\n");
6 fwrite($fh, $data2. "\r\n");
On line 4 I have the normal date return passing that Unix value which is the same value being assigned to the $timestamp variable.
But on line 3 I get a blank return with nothing.
As this unixTime value is generated, it may be coming as a string and the $timestamp parameter is not being accepted by the gmdate function().
– Edson de Senna