Answer the question
In order to leave comments, you need to log in
How to enter the current date in the AR YII2 model?
Actually, a question. What are the features? Search is all about formatting. And how to get the date itself?
Answer the question
In order to leave comments, you need to log in
(new \DateTime('now', new \DateTimeZone('Europe/Moscow')))->format('Y-m-d H:i:s');
))) The model can write time almost automatically. To do this, read the documentation for the TimestampBehavior class. You can record the time the model was created or updated.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question