El problema es que me muestra las fechas sólo en inglés.
No logro hacerlo funcionar con setlocale.
Código PHP :
<?php require_once 'connected.php'; $result; $conn = dbConnect(); $sql = 'SELECT start_date, end_date FROM activeDates'; $result = $conn->query($sql); $rows = $result->fetchall(); ?> <div class="table-responsive"> <table> <thead> <tr> <th></th> <th>Dates</th> </tr> </thead> <tbody> <?php foreach ($rows as $row) { ?> <tr> <td> <?php $start=new DateTime($row['start_date']); $startDay=$start->format('j'); $startMonth=$start->format('F'); $startYear=$start->format ('Y'); $end=new DateTime($row['end_date']); $endDay=$end->format('j'); $endMonth=$end->format('F'); $endYear=$end->format('Y'); $s=( ($startMonth == $endMonth && $startYear==$endYear) ? "$startDay $startMonth till $endDay $endMonth $startYear" : ( ($startMonth!==$endMonth && $startYear==$endYear) ? "$startDay $startMonth till $endDay $endMonth $startYear" : ( ($startMonth==$endMonth && $startYear!==$endYear) ? "$startDay $startMonth $startYear till $endDay $endMonth $endYear" : "$startDay $startMonth $startYear till $endDay $endMonth $endYear" ) ) ); echo $s.PHP_EOL; ?> </td> </tr> <?php } ?>