Php get date now to string
7/21/2007
$d1 = new Datetime(); echo $d1->format('U'); # 1615578862 $ Returns the current time as a UNIX timestamp, referenced either to your server's You can, optionally, pass a format string (the same type as the PHP date() You can use this in phtml file : $objectManager = \Magento\Framework\App\ ObjectManager::getInstance(); $objDate 24 Sep 2020 Get current Date and Time using JavaScript Date object. Use new Date() to get current date in Y-m-d format and current time in H:i:s format. 22 Oct 2019 If you want to get the date in the YYYY-MM-DD format, edit the date_test.html document, and add the following variable: