Horje
php change date format Code Example
php change date format
To convert the date-time format PHP provides strtotime() and date() function. We change the date format from one format to another.

Change YYYY-MM-DD to DD-MM-YYYY
<? php.
$currDate = "2020-04-18";
$changeDate = date("d-m-Y", strtotime($currDate));
echo "Changed date format is: ". $changeDate. " (MM-DD-YYYY)";
?>
php changr date format
$originalDate = "2010-03-21";
$newDate = date("d-m-Y", strtotime($originalDate));
change date format php
$currDate = "2020-08-25";
$changeDate = date("d-m-Y", strtotime($currDate));
echo $changedDate;
php change date format
<?php
  	#https://moneyconvert.net/
    $source = '2012-07-31';
    $date = new DateTime($source);
    echo $date->format('d.m.Y'); // 31.07.2012
    echo $date->format('d-m-Y'); // 31-07-2012
?>
php change date format from d/m/y to y-m-d
$var = '20/04/2012';
$date = str_replace('/', '-', $var);
echo date('Y-m-d', strtotime($date));




Php

Related
php get first 5 characters of string Code Example php get first 5 characters of string Code Example
wordpress get domain Code Example wordpress get domain Code Example
laravel order by random Code Example laravel order by random Code Example
laravel validation pdf Code Example laravel validation pdf Code Example
composer laravel ui Code Example composer laravel ui Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13