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 date php

$var = '21/05/2012';
$date = str_replace('/', '-', $var);
echo date('Y-m-d', strtotime($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 :: date now php 
Php :: Call to undefined method JeroenNotenLaravelAdminLteHelpersMenuItemHelper::isSearchBar( 
Php :: destroy a session in laravel 
Php :: wordpress get_date 
Php :: Get the content of a specific page (by ID) 
Php :: php beautify json 
Php :: rout debug symfony command 
Php :: get the today data laravel 
Php :: the_post_thumbnail add class 
Php :: get_template_directory_uri 
Php :: get the string after a character in php 
Php :: show all terms of a custom taxonomy 
Php :: PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: 
Php :: your requirements could not be resolved to an installable set of packages. composer 
Php :: php return a header 200 
Php :: laravel htaccess tested 
Php :: popup in php 
Php :: string replace smarty 
Php :: codeigniter last insert id 
Php :: laravel redirect external url 
Php :: php get array average 
Php :: ucwords in php 
Php :: how to get the index in foreach loop in laravel 
Php :: how to check if a string contains a substring in php 
Php :: php delay redirect 
Php :: Add 2 days to the current date in PHP 
Php :: php mysql count rows 
Php :: laravel dateinterval not found 
Php :: php change timezone 
Php :: php throw exception 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =