Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php change date format from d/m/y to y-m-d

$var = '20/04/2012';
$date = str_replace('/', '-', $var);
echo date('Y-m-d', strtotime($date));
Comment

change datetime format from Y-m-d h:i:s to d-m-Y in php

$old_date = date('l, F d y h:i:s');              // returns Saturday, January 30 10 02:06:34
$old_date_timestamp = strtotime($old_date);
$new_date = date('Y-m-d H:i:s', $old_date_timestamp);   
Comment

PREVIOUS NEXT
Code Example
Php :: run python script from batch file with arguments 
Php :: php odd or even 
Php :: how to get previous month in php 
Php :: laravel print query with parameters 
Php :: laravel mixed content error 
Php :: php current date 
Php :: string to carbon 
Php :: composer larave install version 
Php :: php artisan down 
Php :: php get unique values by key from array 
Php :: laravel return data from model to another controller 
Php :: codeigniter 4 redirect to home 
Php :: what sign is greater than or equal to php 
Php :: php remove charictors from a string 
Php :: how refresh the record of data in laravel 
Php :: php mysql if not exists insert 
Php :: where laravel function 
Php :: get woocommerce order details Object 
Php :: update-alternatives java 
Php :: collection empty laravel 
Php :: php remove line if it contains string 
Php :: how to get random element from a given array via php faker in laravel 
Php :: php date modify plus 1 day 
Php :: wordpress remove add new button 
Php :: absolute path php 
Php :: Fatal error: Cannot redeclare 
Php :: acf php fields 
Php :: wordpress check if class exists 
Php :: check type in php 
Php :: how to recover xampp deleted files 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =