Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Get GMT+01:00 with php

Please I have search through stackoverflow and couldn't find the right answer to this. I want to output a date for my country Nigeria on a website.

Nigeria timezone is GMT+01:00

I have this

    <?php
         date_default_timezone_set("WAT");

         echo date("M d, Y h:i a")."<p></p>";
         //echo time();
    ?>
like image 210
coder2014 Avatar asked Nov 16 '25 02:11

coder2014


1 Answers

I think you got the timezone wrong.
According to this list it is Africa/Lagos

<?php
date_default_timezone_set("Africa/Lagos");

echo "<p>" . date("M d, Y h:i a") . "</p>";
?>
like image 86
Octfx Avatar answered Nov 17 '25 18:11

Octfx