I am using JDF
library for converting databases dates in my panel. My programming language is php
and i am using while
loop for show data. database date type is datetime
.For example : 2018-07-21 11:14:19.678896
<?php
Include_once "jdf.php";
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$array = explode(' ', $row['date']);
list($year, $month, $day) = explode('-', $array[0]);
list($hour, $minute, $second) = explode(':', $array[1]);
$timestamp = mktime($hour, $minute, $second, $month, $day, $year);
date_default_timezone_set("Asia/Tehran");
$converted_date = jdate("Y/m/d H:i:s", $timestamp);
echo $row['full_name'] . ", reg date:" . $converted_date;
}
When i run code, Y/m/d
become convert BUT for H:i:s
just first row become convert. I really dont know why ...
Can you help me ?