Home forums Using CanvasJS x-axis date from php not working Reply To: x-axis date from php not working

#14128

Vishwas R
Keymaster

@sona2017,

In JavaScript, Date instance is created using new Date().

In your case, changing $x_axis = date(‘D M d Y H:i:s O’, strtotime($csv[$i][0])); to $x_axis = new Date(‘D M d Y H:i:s O’, strtotime($csv[$i][0])); should work fine.


Vishwas R