PHP Classes

File: php/getCurrentTime.php

Recommend this page to a friend!
  Classes of bamigboye biodun   Logical Functions   php/getCurrentTime.php   Download  
File: php/getCurrentTime.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Logical Functions
General-purpose PHP and JavaScript functions
Author: By
Last change:
Date: 1 year ago
Size: 258 bytes
 

Contents

Class file image Download
<?php
function getCurrentTimeWithZone(string $timeZone = null)
{
  if (
$timeZone) {
   
$timeZone = new DateTimeZone($timeZone);
  }

 
$date = new DateTime("now", $timeZone);

  return
$date->format('Y-m-d H:i:s');
}

var_dump(date_default_timezone_get());