strtotime()
FunctionYou can first use the PHP strtotime()
function to convert any textual datetime into Unix timestamp, then simply use the PHP date()
function to convert this timestamp into desired date format.
The following example will convert a date from yyyy-mm-dd format to dd-mm-yyyy.
<?php
$original_date = "2019-03-31";
// Creating timestamp from given date
$timestamp = strtotime($original_date);
// Creating new date format from that timestamp
$new_date = date("d-m-Y", $timestamp);
echo $new_date; // Outputs: 31-03-2019
?>
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
Install Adminer In Laravel 8
When accessing database, command line ac...How to Install Sublime Text 4 on Ubuntu
Sublime text is powerful, lightweight an...Face Detection using Webcam in PHP
In this article, we will share with you...Confirmation alert Before Delete record using jQuery Ajax, PHP and MySQL
While creating web application, it is al...Remove a Package from Laravel using Composer
Composer is dependency manager for PHP p...