Home forums Using CanvasJS MySQL xAxis date format

Tagged: , ,

This topic contains 2 replies, has 3 voices, and was last updated by  Anjali 2 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7075

    FrankGNL
    Participant

    First of all lovely product.

    I use this in combination with MySQL and json
    My date format is “2014-09-23 23:59:59” in mysql DB i would like to only display the time, but somehow this datetime format is nog recognised, can somebody help me out here?

    Regards

    • This topic was modified 2 years, 2 months ago by  FrankGNL.
    #7084

    Daniel Silva
    Participant

    Apparently you have to use milliseconds.
    I’m using strtotime in PHP:

    strtotime($x) * 1000-3600000

    the 3600000 is because I’m on UTC.

    • This reply was modified 2 years, 2 months ago by  Daniel Silva.
    #7089

    Anjali
    Participant

    Hi,

    CanvasJS Expects the value to be either timeStamp or Date object – stings are not parsed automatically. Hence you can either parse the date at client side or use the time Stamp value.

    For displaying the time you can use the valueFormatString property.

    Here is an example.

    ___
    Anjali

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.