1

I have here:

<td><?php print strftime("%d %b. %Y %I:%M %p",mktime($row['c_date'])); ?></td>

and the output is

Notice: A non well formed numeric value encountered in C:\xampp\htdocs\PDO\My-Sample\class.crud.php on line 180
19 Jan. 2018 12:05 AM
Ravi
  • 30,829
  • 42
  • 119
  • 173

1 Answers1

0

Second argument of strftime is timestamp, and you are passing a string. Use strtotime($row['c_date']) function in the second argument and all will be good.

Following are the arguments of strftime from the php docs.

string strftime ( string $format [, int $timestamp = time() ] )

Hence this will work

<td><?php if (isset($row['c_date'])) {
    print strftime("%d %b. %Y %I:%M %p",strtotime($row['c_date'])); 
} ?></td>
Syed Waqas Bukhary
  • 5,130
  • 5
  • 47
  • 59