-5

I want to add +4GMT to the below

<?php echo date("F j, Y, g:i a");?> 

Or anything can help to add the current time and date

CRM SOF
  • 5
  • 1
  • 3
  • Your question has already been asked. Check this answer https://stackoverflow.com/a/2505687/2223027 – pyb Dec 23 '17 at 18:46
  • Are you trying to convert to a different timezone or are you trying to add the timezone and offset to the output? – Mathew Tinsley Dec 23 '17 at 19:06

2 Answers2

0

You can use time() to get the current time in seconds (UNIX) and add 3600*4.

echo date("F j, Y, g:i a", time()+3600*4);
Andreas
  • 23,610
  • 6
  • 30
  • 62
0

you can try this and put timezone accordingly which is gmt +4

<?php 
$dateTime = new DateTime(); 
$dateTime->setTimeZone(new DateTimeZone('America/Los_Angeles')); 
return $dateTime->format('T'); 
?>