Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get current date and time

$today = date("F j, Y, g:i a");   // October 30, 2019, 10:42 pm
$today = date("D M j G:i:s T Y"); // Wed Oct 30 22:42:18 UTC 2019
$today = date("Y-m-d H:i:s");     // 2019-10-30 22:42:18(MySQL DATETIME format)
Comment

How to get the current date in PHP?

<?php
 $date = date('Y-m-d H:i:s');
 echo $date;
 ?>
Comment

php current date get

date_default_timezone_set('Asia/Kolkata'); 
echo date("Y-m-d H:i:s"); // time in India
Comment

php current date

# Current date
date_default_timezone_set('Asia/Kolkata'); 
echo date("Y-m-d H:i:s"); 

# Current Time
date_default_timezone_set("America/New_York");
echo "The time is " . date("h:i:sa");
Comment

Get the Current Date and Time in PHP

phpCopy<?php
$Object = new DateTime();  
$DateAndTime = $Object->format("d-m-Y h:i:s a");  
echo "The current date and time are $DateAndTime.";
?>
Comment

php get current time and date

date("Y-n-j G:i:s");
//-->2020-10-29 23:27:15
Comment

Get the Current Date and Time in PHP

phpCopy<?php
$DateAndTime = date('m-d-Y h:i:s a', time());  
echo "The current date and time are $DateAndTime.";
?>
Comment

How do I get the current date and time in PHP?

//Your Country Time Zone: https://www.php.net/manual/en/timezones.php

date_default_timezone_get(Asia/Dhaka);

$dateYmd = date('Y-m-d');
echo "Current Year Month Day: $dateYmd";
//Current Year Month Day: 2022-01-14

$datehms = date('h:i:s');
echo "Current Hour Minute Second: $datehms";
//Current Hour Minute Second: 10:33:58
Comment

Get the Current Date and Time in PHP

phpCopy<?php
date_default_timezone_set('Europe/Amsterdam');    
$DateAndTime = date('m-d-Y h:i:s a', time());  
echo "The current date and time in Amsterdam are $DateAndTime.
";
date_default_timezone_set('America/Toronto');    
$DateAndTime2 = date('m-d-Y h:i:s a', time());  
echo "The current date and time in Toronto are $DateAndTime2.";
?>
Comment

Get the Current Date and Time in PHP

phpCopy<?php
$Object = new DateTime();  
$Object->setTimezone(new DateTimeZone('Europe/Amsterdam'));
$DateAndTime = $Object->format("d-m-Y h:i:s a");  
echo "The current date and time in Amsterdam are $DateAndTime.
";
$Object->setTimezone(new DateTimeZone('America/Toronto'));
$DateAndTime = $Object->format("d-m-Y h:i:s a");  
echo "The current date and time in Toronto are $DateAndTime.";
?>
Comment

php get current date

angular js tabs
  
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress register post type 
Php :: laravel get items by ids 
Php :: execute specific migration laravel 
Php :: how to echo only certain character number in php 
Php :: php isset array 
Php :: delete bunch of rows in laravel 
Php :: construtor php 
Php :: reload page laravel 
Php :: php join array with comma 
Php :: menampilkan hari dan tanggal sekarang di php 
Php :: php datetime sub minutes 
Php :: how to get data from a table in laravel 
Php :: cambiar entre versiones de php linux 
Php :: codeigniter 3 or where not in 
Php :: laravel run schedule locally 
Php :: php sort by associative array value 
Php :: push key and value in laravel 
Php :: create function parameters php 
Php :: how to install php dependencies 
Php :: cut long text laravel blade 
Php :: Clear from faild_jobs laravel 
Php :: laravel routes resource 
Php :: ubuntu install php 7 
Php :: transform text to lowercase and replace space with dash php 
Php :: get post data in laravel 
Php :: in array php multiple values 
Php :: how to use stored procedure in laravel 
Php :: add item to array in php 
Php :: destrroy a session php 
Php :: laravel add auto increment 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =