Search
 
SCRIPT & CODE EXAMPLE
 

PHP

pasar datetime a string php

$theDate    = new DateTime('2020-03-08');
echo $stringDate = $theDate->format('Y-m-d H:i:s');

//output: 2020-03-08 00:00:00
Comment

pasar datetime a string php

$date = date_create_from_format('d M, Y', '08 Mar, 2020');
echo $newFormat = date_format($date,"Y/m/d H:i:s");

//output: 2020/03/08 00:00:00
Comment

pasar datetime a string php

$dateFormat = new DateTime(); // this will return current date
echo $stringDate = $date->format(DATE_ATOM);

//output: 2020-03-08T12:54:56+01:00
Comment

pasar datetime a string php

$date = explode("/",date('d/m/Y/h/i/s')
list($day,$month,$year,$hour,$min,$sec) = $date);
echo $month.'/'.$day.'/'.$year.' '.$hour.':'.$min.':'.$sec;

//output: 03/08/2020 02:01:06
Comment

PREVIOUS NEXT
Code Example
Php :: get last 30 days records in laravel 
Php :: php error reporting show warnings 
Php :: page load time in php 
Php :: php curl delete request 
Php :: ip condition in php 
Php :: laravel seed specific file 
Php :: php check if non-object 
Php :: print all session in codeigniter 
Php :: datetime to string php 
Php :: install phpmyadmin ubuntu 
Php :: lravel redirect with error 
Php :: php mysqli connection check 
Php :: wordpress echo the excerpt 
Php :: ian holm 
Php :: wordpress user enumeration 
Php :: You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with `--ignore-platform-req=ext-curl` to temporarily ignore these required extensions. 
Php :: laravel return 1 as true 
Php :: php mysql insert data 
Php :: laravel where creation is today carbon 
Php :: Carbon add 3 hours 
Php :: laravel updateorcreate 
Php :: wordpress get post time 
Php :: if name value contains space in php 
Php :: save html form data to text file using php 
Php :: laravel flutter save image in data 
Php :: get category name by id wordpress 
Php :: php bbcode tag dellete 
Php :: yii2 advanced nginx 
Php :: laravel enum migration 
Php :: array merge php 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =