0

when I call Date("H")

<?php echo Date("H"); ?>

it displays 01 but the current time is 9:45 AM, its supposed to display 09 right?

output:

enter image description here

current time :

enter image description here

I tried to restart service and also restart the computer but its still 01

1 Answers1

0

Probably your timezone is wrong, try to set this before your code:

date_default_timezone_set('America/Fortaleza');

Change 'America/Fortaleza' to your timezone.

You can set it in php.ini too:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Fortaleza"
Raphael Sá
  • 66
  • 1
  • 6