Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php convert string to date

$time = strtotime('10/16/2003');

$newformat = date('Y-m-d',$time);

echo $newformat;
// 2003-10-16
Comment

php string to date

$s = '06/10/2011 19:00:02';
$date = strtotime($s);
echo date('d/M/Y H:i:s', $date);
The above one is the one of the example of converting a string to date.
echo $s ->format('Y-m-d');
The above one is another method 
Comment

string to datetime php

$s = '06/10/2011 19:00:02';
$date = strtotime($s);
echo date('d/M/Y H:i:s', $date);
Comment

convert string to date php

$s = '08/11/2010 19:37:02';
$date = strtotime($s);
echo date('Y-m-d H:i:s', $date);
Comment

Convert String to Date and Date-Time in PHP

phpCopy$oldDate = strtotime('03/08/2020');

$newDate = date('Y-m-d',$time);

echo $newDate;
//output: 2020-03-08
Comment

Convert String to Date and Date-Time in PHP

phpCopyecho $dateNew = DateTime::createFromFormat('m-d-Y', '03-08-2020')->format('Y/m/d');
//output: 2020/03/08
Comment

Convert String to Date and Date-Time in PHP

phpCopyecho $dateNew = date_create_from_format("m-d-Y", "03-08-2020")->format("Y-m-d");
//output: 2020/03/08
Comment

php string to date

$s = '06/10/2011 19:00:02';$date = strtotime($s);echo date('d/M/Y H:i:s', $date); The above one is the one of the example of converting a string to date. echo $s ->format('Y-m-d'); The above one is another method 
Comment

PREVIOUS NEXT
Code Example
Php :: first character uppercase php 
Php :: page load time in php 
Php :: How to display the fps in pygame 
Php :: take files from one folder and move to another folder in php 
Php :: full url php 
Php :: write to file laravel 
Php :: importing current year in laravel blade 
Php :: order By Asc in laravbel 
Php :: common array methods php 
Php :: comment supprimer balise script hmtl en php regex 
Php :: print session in laravel 
Php :: how to install php fm 
Php :: hwo to limit char in php 
Php :: wp get user meta 
Php :: E: Unable to locate package php7.2-mbstring 
Php :: laravel rename column name 
Php :: php get ip address 
Php :: convert to int laravel 
Php :: - root composer.json requires php ^7.1.3 but your php version (8.0.3) does not satisfy that requirement. 
Php :: php datetime object get unix timestamp 
Php :: wp+get feature image 
Php :: php get uploaded file extension 
Php :: php discord webhook 
Php :: wp safe redirect 
Php :: decode jwt token laravel 
Php :: send variable to get_template_part 
Php :: php subtract mins to datetime 
Php :: laravel auth register false 
Php :: make model controller in single command 
Php :: group users on country vice in laravel 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =