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

Datetime to string php


<?php
$date = new DateTime('2000-01-01');
echo $date->format('Y-m-d H:i:s');
?>

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

Convert DateTime to String in PHP

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

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

Convert DateTime to String in PHP

phpCopy$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

Convert DateTime to String in PHP

phpCopy$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

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

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

Convert DateTime to String in PHP

phpCopydefine ('DATE_ATOM', "Y-m-dTH:i:sP");
define ('DATE_COOKIE', "l, d-M-y H:i:s T");
define ('DATE_ISO8601', "Y-m-dTH:i:sO");
define ('DATE_RFC822', "D, d M y H:i:s O");
define ('DATE_RFC850', "l, d-M-y H:i:s T");
define ('DATE_RFC1036', "D, d M y H:i:s O");
define ('DATE_RFC1123', "D, d M Y H:i:s O");
define ('DATE_RFC2822', "D, d M Y H:i:s O");
define ('DATE_RFC3339', "Y-m-dTH:i:sP");
define ('DATE_RSS', "D, d M Y H:i:s O");
define ('DATE_W3C', "Y-m-dTH:i:sP");
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

Convert DateTime to String in PHP

phpCopy$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 :: php slice last arrat 
Php :: codeigniter base_url 
Php :: php path in ubuntu 
Php :: laravel migrations rename table 
Php :: delete and return response and nocontent laravel 
Php :: laravel How to capture output in a file from php artisan test 
Php :: h:i:s explode in php by ":" 
Php :: check the request type in laravel 
Php :: php explode end 
Php :: como destruir uma variavel de sessão 
Php :: php exec get pid 
Php :: laravel middleware in constructor 
Php :: .htaccess Prevent access to php.ini 
Php :: start php file 
Php :: laravel auth setup 
Php :: fillable property to allow mass assignment 
Php :: How to add custom button in wordpress admin section 
Php :: laravel blade @auth 
Php :: dispatch job with queue name in laravel 
Php :: php define array first 10 number 
Php :: php != operator 
Php :: symfony messenger routing 
Php :: laravel crud generator 
Php :: livewire call another component 
Php :: laravel Form::hidden 
Php :: php Program for Sum of the digits of a given number 
Php :: explode return empty array 
Php :: display pdf file in laravel 
Php :: magento2 move Exception #0 (Exception): Notice: Undefined offset: 2 in /var/www/nucleus/htdocs/vendor/magento/framework/Encryption/Encryptor.php on line 591 
Php :: get data from csv file in php and print in table 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =