-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
  • 3,596
  • 7
  • 39
  • 97

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,018
  • 4
  • 13
1

You can set your timezone

date_default_timezone_set('America/Los_Angeles');
Ravi
  • 29,945
  • 41
  • 114
  • 168
-1

You can set timezone for your time using date_default_timezone_set