SyntaxFix
Write A Post
Hire A Developer
Questions
I didn't mean to copy the same answer, that is why I didn't accept my own answer.
Actually when I add use DateTime in top of the controller solves this problem.
use DateTime