P
P
project69612017-08-31 01:09:40
PHP
project6961, 2017-08-31 01:09:40

Exam Design integration and platform setup, how to display a block depending on time?

Good day. I'm taking my first full-time Bitrix exam. I solved all the tickets, but got stuck in such tasks as:
Implement a different display of information in the header. If now the time (on the server) is
working (from 9 to 18), then the phone is displayed, if not working then
email
Implement different display of information in the header. If today is the 1st day of the month, then display a black logo, otherwise a color one.
Please help with a solution.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolay S., 2017-08-31
@project6961

Read about the datetime class. ( php.net/manual/ru/class.datetime.php)
You can get time, date from it. Very useful in php.
$now = new DateTime();
Pay attention to format, modify, diff methods

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question