Home > front end >  echo date(d-m-Y) in highchart
echo date(d-m-Y) in highchart

Time:01-05

Working on high-chart -> pie chart

when i am trying to echo date(d-m-Y) it will subtract instead of print dd-mm-yyyy

data: [
    <?php foreach($result as $value):?>
        {
            name: <?php $d= strtotime($value['created_at']); echo date('d-m-Y', $d);?>,
            y: <?php echo round($calc_quality = $value['goodcount']/($value['totalcount']   0.0001 )*100,2); ?>
        },
    <?php endforeach?>
]

I want it to be 13-11-2021.Any solution?

pie chart

CodePudding user response:

adding ' ' solved it :

name: '<?php $d= strtotime($value['created_at']); echo date('d-m-Y', $d);?>',

  •  Tags:  
  • Related