Click here to Skip to main content
15,393,706 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In my sql table I have a date 2022-06-26, so when I open my html table is show 2022-06-26, but how do I get it to show 26 Jun 2022.

I did search, but cannot find the correct way do do it..

This is my code that I have.

<pre><td style="color:#EFE1CE"><?php echo $checkSqlRow["CREATED_AT"]; ?>

did try this code, but do not understand where to put it.
    $orgDate = "2019-09-15";  
    $newDate = date("d-m-Y", strtotime($orgDate));  
    echo "New date format is: ".$newDate. " (MM-DD-YYYY)";  

What I have tried:

Did search and tried the above, but cannot get it working
Updated 26-Jun-22 21:34pm

1 solution

Something like:
$newDate = date("d-m-Y", strtotime($crdate)); // use different format string as required.
<td style="color:#EFE1CE"><?php echo $newDate; ?>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900