Answer the question
In order to leave comments, you need to log in
Get timestamp for today's 00:00 Moscow time?
The essence of the question is in the title. What is the easiest way to get unix timestamp 00:00 of the current day for the Moscow time zone.
Moreover, the current time zone in the script can be different, and it is not recommended to change it.
Answer the question
In order to leave comments, you need to log in
It may be useful to someone, I couldn’t think of an easier one
function GetMidnightTime($timeZone = 'Europe/Moscow')
{
$d = new \DateTime(null, new \DateTimeZone($timeZone));
$d->setTime(0, 0, 0);
return $d->getTimestamp();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question