O
O
Oleg2019-02-12 13:36:34
PHP
Oleg, 2019-02-12 13:36:34

How to set the time in mail php for sending requests from the site?

Hello
everyone, there is mail.php, applications from the site are sent through it, and in the process of sending the file adds some information about the user, such as ip, browser name, and the time at which the application was made.
Actually the question is how to set the time adjustment, because the date that is displayed in the letter is not in my time zone.
Tried to add UTC+, set date_default_timezone_set() in this file itself, but was unsuccessful.
here is that part of the code
$ip=$_SERVER["REMOTE_ADDR"];
$browser=$_SERVER["HTTP_USER_AGENT"];
$referer = getenv('HTTP_REFERER');
$date = date("dmy");
$time = date("H:i");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ipokos, 2019-02-12
@ipokos

Server time is taken (may differ from yours) Locales
are used for this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question