-2

Now date in my country 10.01.2018 and time 10:03. My time zone name is "Asia/Tashkent" and if I write in code:

echo date_default_timezone_get();
echo date('d-m-y H:m');

Displayed timezone name: Europe/Moscow Date Time: 10-01-18 08:01

How I can get my timezone and my current date?

Andreas Hunter
  • 4,504
  • 11
  • 65
  • 125

3 Answers3

6

Set it first with date_default_timezone_set() function

date_default_timezone_set("Asia/Tashkent");
echo date('d-m-y H:m');
Luffy
  • 1,028
  • 5
  • 13
1

You can set your timezone

date_default_timezone_set('America/Los_Angeles');
Ravi
  • 30,829
  • 42
  • 119
  • 173
-1

You can set timezone for your time using date_default_timezone_set